Hi,
i'm kind of new to linux and running scripts directly from the command line
my server version is Ubuntu 14.04. (my php version is 5.5.9). I was trying to set up a cron job to run a php script, but was having no success. so i decided to see if the script would just run via the command line (runs fine using a browser).
the error i'm getting is
what the error is trying to say… my mysql query is failing. the code on line 503 is
not sure why it would fail by running it via command line, whereas it runs successfully via a browser. where am i going wrong, or what tweaks do i need to make and where?
here's a little bit more code for some context….
i'm kind of new to linux and running scripts directly from the command line
my server version is Ubuntu 14.04. (my php version is 5.5.9). I was trying to set up a cron job to run a php script, but was having no success. so i decided to see if the script would just run via the command line (runs fine using a browser).
the error i'm getting is
PHP Fatal error: Call to a member function query() on a non-object in /var/ on line 503
what the error is trying to say… my mysql query is failing. the code on line 503 is
Code:
$stmt = $db->query($SQL);
not sure why it would fail by running it via command line, whereas it runs successfully via a browser. where am i going wrong, or what tweaks do i need to make and where?
here's a little bit more code for some context….
Code:
line 503 $stmt = $db->query($SQL);
line 504 while($col = $stmt->fetch(PDO::FETCH_ASSOC)) {
line 505 etc, etc…