<?
$query1 = "select vote1 from user where id=$uid";
$data1 = mysql_query($query1);
$datarows = mysql_num_rows($data1);
if($datarows > 0) {
//what you'll do with the result
}
?>
now if i use a mysql_num_rows wouldnt that just give me a result showing how many rows i got? i want to show the actual data in a row.. like the actual result of query1
if i do like a..
<?
$query1 = "select vote1 from user where id=1";
$data1 = mysql_query($query1);
$datarows = mysql_result($data1,0);
if($datarows > 0) {
//what you'll do with the result
echo $datarows;
}
?>
i will get the results for id 1..
but if i change it and do like a
<?
$query1 = "select vote1 from user where id='id'";
?>
i end up getting Warning: Unable to jump to row 0 on MySQL result index 9 in /home2/www/abda53/vote/user/user.php3 on line 80 *line 80=$datarows = mysql_result($data1,0);
so how would i do a query for a result on vote1, but for the id make it like $id?