Jump to content

making this code MySQL 4.0.13 compliant


Gappa

Recommended Posts

Can some one help me make this code MySQL 4.0.13 compliant...

 

 

 

[php:1:adb89efbc6]

 

<?php

$db = mysql_connect(\"localhost\", \"Gappa\", \" \");

mysql_select_db(\"Gappa\",$db);

 

 

$query = \'SELECT topic_title, topic_id, FROM_UNIXTIME(topic_time,\"%W the %D %M @ %r\") AS Topic_Date, post_text, username FROM phpbb_topics RIGHT JOIN phpbb_posts_text ON topic_first_post_id=post_id RIGHT JOIN phpbb_users ON topic_poster=user_id WHERE forum_id=6 ORDER BY topic_time DESC\';

$result = mysql_query($query, $db) or die ($query .\': \'.mysql_error());

 

 

while($row = mysql_fetch_assoc($result))

{

echo \"<br/><b><FONT FACE=Arial SIZE=-1 COLOR=#6699FF>\";

echo \"$row[topic_title]:</FONT></b><br/>\";

echo \"<FONT FACE=Arail SIZE=-2 COLOR=#999999>posted by: <b>$row[username]</b>\";

echo \" on: \";

echo \"$row[Topic_Date]</FONT><br/><hr><br/>\";

echo \"<FONT FACE=Arail SIZE=-1 COLOR=#FFFFFF> $row[post_text]</FONT>\";

echo \"<br/><br/>\";

echo \"<FONT FACE=Arial SIZE=-2>\";

echo \"<a href=\"http://www.hostultra.com/~Gappa/phpBB2/viewtopic.php?t=$row[topic_id]\"><b><FONT COLOR=#6699FF>Read comments</FONT></b></a></FONT>\";

echo \"<br/><br/>\";

}

 

 

 

?>

[/php:1:adb89efbc6]

 

 

 

This code works with earlier version of MySQL, but now with 4.0.13 its giving me the following error

 

Cross dependency found in OUTER JOIN. Examine your ON conditions

 

I believe the solution lays some where here: http://www.mysql.com/doc/en/JOIN.html

 

Not really sure what to do... thanks

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.