Archived

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

sathenzar

I'm going to go insane....

Recommended Posts

sathenzar    100
I'm trying to get this g**damned pos to work. IT's plain english but the dang thing won't work and I've been on it literally all day. I'm trying to transfer the data over to the next page for my forum exp: General and get it to work with this code:
$sql = "SELECT * FROM $topic";
$result = mysql_query($sql, $dbh);
while($row = mysql_fetch_array($result)) {
$topic_name = $row[ 'topic_name' ];
$topic_stat = $row[ 'topic_stat' ];
$topic_usr = $row[ 'usr' ];
$topic_usrid = $row[ 'usrID' ];
$topic_id = $row[ '$select' ];
echo "<td bgcolor='#000022' valign=top align=left style='border: 2px solid white'><a href='displaythread.php?thread_id=$topic_id&topic=$topic'>$topic_name</a>\n";
But it won't work. It won't tell it to retive the data from generalID. It just ignores it b/c it's an idiot and stupid. WHY? It's plain english to transfer the damn data over. I want the stupid thing to work or I'm going to go postal.
To show you bewtter of what I mean, Click here [edited by - sathenzar on January 24, 2004 9:49:26 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Please don''t go insane on the board. It leaves a big mess that someone else has to clear up

Is you initialisation code for mysql all correct ? try printing variable values to the page temporarily. Does $topic exist & is it a valid table, why are you selecting everything from the whole table ....

Share this post


Link to post
Share on other sites
sathenzar    100
Yes I did and it echoed out generalID, so the MySql code is just being stubborn. It should work. It does with every other part of my code, just not this one.

Share this post


Link to post
Share on other sites
Leffe    301
$sql = "SELECT * FROM $topic";

What''s in $topic?

$result = mysql_query($sql, $dbh);

Check return value?

while($row = mysql_fetch_array($result)) {

mysql_fetch_assoc()?

Share this post


Link to post
Share on other sites