The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
trying to get the latest articles from my database and it's returning: Fatal error: Call to undefined function: sql_fetch_row() in /path/to/home
i tried mysql_fetch_row and still gives me an error, any ideas? Code:
<?php
$dbhostname= "localhost";
$dbusername= "";
$dbpassword= "";
$dbdatabase= "";
$table ="db_stories";
$db = @mysql_connect($dbhostname,$dbusername,$dbpassword);
$result = @mysql_query("SELECT sid, title, comments, counter from $table order by sid DESC limit 0,5", $db);
while(list($sid, $title, $comtotal, $counter) = sql_fetch_row($result, $db)) {
}
?>
|
|
#2
|
|||
|
|||
|
The valid function is mysql_fetch_row($result).
|
|
#3
|
||||
|
||||
|
okay, this is the entire script and it gives me: Warning: Wrong parameter count for mysql_fetch_row() in /home/path/
what gives, am i doing something wrong? Code:
<?php
$dbhostname= "localhost";
$dbusername= "db_user";
$dbpassword= "db_pass";
$dbdatabase= "db_name";
$table ="db_stories";
$db = @mysql_connect($dbhostname,$dbusername,$dbpassword);
$result = @mysql_query("SELECT sid, title, comments, counter from $table order by sid DESC limit 0,5", $db);
while(list($sid, $title, $comments, $counter) = mysql_fetch_row($result, $db)); {
}
?>
|
|
#4
|
|||
|
|||
|
The only parameter needed in the function mysql_fetch_row() is the query resource, so get rid of ', $db'.
Also, why do you have a semicolon ( at the end of the line with the mysql_fetch_row function?
|
|
#5
|
||||
|
||||
|
lol. i just noticed that semicolon, i removed it. thanks, it's working now, such a simple mistake can cause it not to work.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|