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


Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.