SJames Posted September 16, 2007 Share Posted September 16, 2007 $result = mysql_query("SELECT * FROM page_content WHERE cID = '$cID'") or die ("Select Error"); $resultArray = mysql_fetch_array($result) or die ("Array Error"); It already connects properly and everything but when it gets to the fetch_array part, I get the "Array Error" error. I can't figure out why this doesn't work. mysql_fetch_row doesn't work either. Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/ Share on other sites More sharing options...
Jessica Posted September 16, 2007 Share Posted September 16, 2007 print out the sql? Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349758 Share on other sites More sharing options...
SJames Posted September 16, 2007 Author Share Posted September 16, 2007 I'm just trying to make the array here... Printing it doesn't work because the array doesn't get made. If it's important, printing out $result returns "Resource ID#3". Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349759 Share on other sites More sharing options...
marcus Posted September 16, 2007 Share Posted September 16, 2007 What are you echo'ing? Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349761 Share on other sites More sharing options...
SJames Posted September 16, 2007 Author Share Posted September 16, 2007 I'm not echoing anything yet, I'm trying to get the mysql_fetch_array to work, it still gives me the error. Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349763 Share on other sites More sharing options...
SJames Posted September 16, 2007 Author Share Posted September 16, 2007 Oh, never mind -- I got it working... Thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349765 Share on other sites More sharing options...
darkfreaks Posted September 16, 2007 Share Posted September 16, 2007 <?php mysql_select_db("mydb");/// need to select a database after connecting to script then do your query $result = mysql_query("SELECT * FROM page_content WHERE cID = '$cID'") or die ("Select Error"); $resultArray = mysql_fetch_array($result) or die ("Array Error");?> Quote Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349766 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.