I am a php noob. I am following along with a tutorial. I have the same exact database tables, fields, etc and I have the same exact code as the tutorial but yet I am getting an error and his works....I searched for an answer on a few forums and the same question is asked but never really answered. I the info I am selecting from the db is there so that is not it....thanks in advanced
THE ERROR
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\jobolicious\db_fns.php on line 34
THE CODE
function db_connect(){
$connection = mysql_connect('localhost','user','pass','db')
or die('Not Connected!');
}
function find_jobs(){
db_connect();
$select ="SELECT
id,
location,
title,
company,
description,
url";
$from = "FROM
jobs";
$where = "WHERE
id > 0";
$query = $select . $from . $where;
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
print_r($row);
}
}
find_jobs();