StirCrazy Posted May 26, 2006 Share Posted May 26, 2006 Can someone help me with the correct syntax for the following ~ not sure what i'm doing wrong.trying to call username,sr_classifieds_score,sr_classifieds_pcnt and put them in $username,$score,$percentagekeep getting mysql_fetch_row(): supplied argument is not a valid MySQL result resource on line 15 - list($username,$score,$percentage) = mysql_fetch_row($r);Thanks in advance.S.C>[code]<?php$db = "******";$dbname = "*******";$dbpass = "********";$link = mysql_connect ('localhost', $dbname, $dbpass) or die;@mysql_select_db('$db', $link);function my_query($sql) { global $link; $result = @mysql_query($sql, $link); if ($result) return $result;} $r = my_query("select username,sr_classifieds_score,sr_classifieds_pcnt from user where userid='$user_id'"); list($username,$score,$percentage) = mysql_fetch_row($r); @mysql_close( $link ); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10508-php-mysql/ Share on other sites More sharing options...
Barand Posted May 26, 2006 Share Posted May 26, 2006 [code]@mysql_select_db('$db', $link);[/code]Remove the single quotes from '$db' Quote Link to comment https://forums.phpfreaks.com/topic/10508-php-mysql/#findComment-39316 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.