mysql query returns the value in the first column for all the other columns

bk18

New Member
Hi I made a query to a table below and when I tried to get the value in each column , it returns the same value from the first column for all the other columns. To elaborate
In my database table I have the following:
\[code\]owner_id = 21pet_id = 1name = fluffycolor = greentype = dogsub_type = boxerlocation = LA\[/code\]however whenever I try to access one column, say the name column, it returns 21 which is thevalue in the owner_id column corresponding to that pet_id. I am not sure why this ishappening. \[code\]$query = sprintf("SELECT * FROM `petAttributes` where pet_id ='%d'",$p_id); $result = performQuery($query); $owner_id = stripslashes(mysql_result($result,"owner_id")); $pet_id = stripslashes(mysql_result($result,"pet_id")); $name = stripslashes(mysql_result($result,"name")); $color = stripslashes(mysql_result($result,"color")); $type = stripslashes(mysql_result($result,"type")); $sub_type = stripslashes(mysql_result($result,"sub_type")); $loc = stripslashes(mysql_result($result,"location"));\[/code\]Information on my environment
PHP Version 5.2.14
MYSQL version 5.0.67
 
Back
Top