n!ch0
2010-11-01 15:05:52 UTC
Visit: http://phpeasystep.com/mysql/6.html
One year ago, using the method on this website, I was able to select all columns from 1 row in a table and display those values anywhere I wanted to on a page.
------------------Quote From Website------------------
// Select all columns from one row.
"SELECT * FROM table_name WHERE column_name=' value in column '";
...
If you don't want looping rows in mysql, replace
while($rows=mysql_fetch_array($result)){
........
with this
$rows=mysql_fetch_array($result);
------------------Quote From Website------------------
People have been telling me the problem is that the syntax is wrong, that the values in the database are wrong, that my brother's dog is eating his food wrong and someone tripped on a wire...
NO. I appreciate all the help from the same problem in a previous question, but I've tried all your suggestions prior to you all suggesting them, and they still didn't work (before and after)
I know this because I'm able to print ALL values from a table using a while loop
However, when I attempt to grab all the columns from one row using:
$sql = "SELECT * FROM users WHERE id='$id'";
$result = mysql_query($sql);
$rows = mysql_fetch_array($rows);
It doesn't work. I can honestly say, I used this EXACT method one year ago - flawlessly. No problems. If I told it to jump, it would. So, what gives? Any help would be appreciated