Solarpitch Posted March 18, 2008 Share Posted March 18, 2008 Hey, Is there an reason why the value of $row[4] below will not assign its value to the array? When I try to print the value out noting will display but when I hard code in a test value... $myinfo[1] = "test"; that will print out fine. <?php ... dbconnect(); $myinfo = array(); $sql = "select * from golfpro_time_sheet where realdate= '".$teedate."' and slots < ".$players.""; $row = mysql_fetch_row($sql); $myinfo[1] = $row[4]; return $myinfo; ... ?> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 18, 2008 Share Posted March 18, 2008 You're syntax is fine. What's in $row[4]? do a <?php echo '<pre>' . print_$($row,true) . '</pre>'; ?> after the mysql_fetch_array() BTW, you might want to use the mysql_fetch_assoc() function instead, then you can use the field names as array indexes. Ken Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 18, 2008 Share Posted March 18, 2008 Ummm. There is no mysql_query() in the code. You are not querying the database, so the mysql_fetch_xxxxx() has no results to be fetching. Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted March 18, 2008 Author Share Posted March 18, 2008 Thats the problem PFMaBiSmAd. Somethings are easily overlooked. Thanks lads. Quote Link to comment 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.