So I took a website which is currently live and transferred everything to my computer so I can work on it locally. I am in the process of getting everything working locally but can't get my MySQL queries to work. I am connected to a database which is identical to the original database that the website was running on.
The error I'm getting is: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in... (yes I am going to move everything to mysqli once I get this working)
I've tested very simple queries and had no luck. Here is one I tried:
<?php
$con = mysql_connect('localhost', 'root', null, 'database_name') or die("Could not connect.");
echo mysql_result(mysql_query("SELECT `data` FROM `test-table` WHERE `id` = 0"), 0);
?>
Does this have something to do with the fact that I am running locally?
I'm running this on WAMP, Apache/2.4.2 (Win64) PHP/5.4.3