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. 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? 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". 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? 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. 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. 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");?> Link to comment https://forums.phpfreaks.com/topic/69598-solved-fetch-array/#findComment-349766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.