Jump to content

I have no idea what is going on. Php not working.


Alex1646

Recommended Posts

OMFG! I have no idea what is going on!

<?php
if (isset($user_log))
{
//************************************************************************************************************************************************
$user =  $_SESSION['user'];
$query = "
SELECT title, sum, story_id
FROM draft
WHERE user='$user'

";
$select = mysql_query($query); 



while($rows = mysql_fetch_assoc($select));
{


$titledb = $rows['title'];
$sumdb = $rows['sum'];
$id_db = $rows['story_id'];
echo "$titledb";



}

}

//*************************************************************************************************************************************************
?>

I have no idea whats going on I have tried:

1. Using mysql_num_rows

    I get a number (1)

2.Trying to use the mysql_fetch_assoc outside of the while loop.

    The values are getting echo'ed out, but when I put the code in the while loop and the

$rows=mysql_fetch_assoc


  • in the while peramiters, nothing happening.
    I have also tried putting other code in the while loop and it works. Its just the mysql values.
     
    also I tried using or die(mysql_errror()),
    It dies but no mysql error


OMG.  :facepalm:

Really??? I spent like a hour debugging that code, and it was something as mundane as a semicolon. Well, at least I will never be making that mistake again.

Thanks for everyone who read this post, and thanks even more to everyone who helped me!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.