Forum Moderators: coopster

Message Too Old, No Replies

Looking for help in a php code

pulling a mysql table data through php

         

ajaykumarmeher

6:48 am on Jul 27, 2009 (gmt 0)

10+ Year Member



I am looking for help with the following:

I have a mysql table where I hv user name and password etc.
I have another mysql table with username and user work hour, user performance rating and number of days worked.

As soon as the user login to the site, I want to show the user his work hour till tht date, his performance ratng till that day and total number of days he has worked till tht date.

I am using php and mysql, so how to accomplish this?

Can some one help me with the code to accomplish this objective. I will really be glad for the help.

mvaz

11:50 am on Jul 27, 2009 (gmt 0)

10+ Year Member



select cols from table where userID = whatever and echo the same in tabular form.

ajaykumarmeher

5:20 pm on Jul 27, 2009 (gmt 0)

10+ Year Member



It seems you did not understand quite well what I am looking for.

Anyway I have been able to pull the user specific data from the table but there is still a minor issue. When the user logs in for the first time it does not show the data. If user logs out and logs in again, it shows the user specific data.

I am using the following code:

<?php $q=explode('¦',end($_COOKIE));
$login=$q[0];
$k=mysql_query("select * from user_data where user_login = '$login' limit 1;");
$r=mysql_fetch_assoc($k); ?>

<ul><li>
<?php echo $r[Days worked]; ?><br>
<?php echo $r[Money earned]; ?><br>
<?php echo $r[Efficiency]; ?><br>
<?php echo $r[Completed task]; ?><br>
</li></ul>

So where is the issue that is not pulling data in the first login itself.

ajaykumarmeher

7:20 pm on Jul 27, 2009 (gmt 0)

10+ Year Member



Bumping this thread as I am desperately looking for a solution to it...