MySQL Forums
Forum List  »  PHP

SELECT stopping PHP script execution
Posted by: Sam Southard
Date: September 19, 2014 12:48PM

I'm hoping that someone out there can help me with what I'm sure is a very simple problem, but has me tearing my hair out.

I have a very simple bit of PHP code using mysqli that's giving be trouble. The code is basically:

$query = "SELECT Field FROM Table";
$stmt = dbConnection->prepare($query);
$stmt->execute();

This code stops the execution of my script. It appears to be related to the SELECT, as if I replace the first line with something like:
$query = "UPDATE Table SET Field=1 WHERE Field=1";

then the script executes -- the query doesn't do anything, of coure, but the script continues from there on.

I have other SELECT queries that work just fine elsewhere in my web page, but I know I must be doing something wrong somewhere -- perhaps in a different part of the code. The above use of the $stmt variable is the first time it's used in that function.

Has anyone seen anything like this before? If so, how did you solve it? If it matters, I'm using Microsoft WebMatrix to develop this application and the database is hosted on a Zend development server, both on the same machine.

If this isn't the right place for this, please point me in the right direction.

Thanks in advance

Options: ReplyQuote


Subject
Written By
Posted
SELECT stopping PHP script execution
September 19, 2014 12:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.