vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   what is wrong? (https://vborg.vbsupport.ru/showthread.php?t=46672)

Sebastian 12-14-2002 06:08 PM

what is wrong?
 
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)) {

}

?>


GSHelpBoy 12-14-2002 07:23 PM

The valid function is mysql_fetch_row($result).

Sebastian 12-14-2002 07:47 PM

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)); {

}

?>


GSHelpBoy 12-14-2002 10:19 PM

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?

Sebastian 12-14-2002 11:23 PM

lol. i just noticed that semicolon, i removed it. thanks, it's working now, such a simple mistake can cause it not to work.


All times are GMT. The time now is 12:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03250 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete