MySQL Forums
Forum List  »  PHP

Re: SQL error on php page
Posted by: Mark Hwang
Date: March 15, 2018 05:40PM

I tried that and the error on the php page was:

SQL Statement Error: SELECT * FROM CustomerInterestsView WHERE CustomerLastName = 'Doe' AND CustomerFirstName = 'John'

I copied the statement and ran it in MySQL and it gave the correct results. The problem section is shown below. Again the new customer (John Doe) was inserted properly and could be used to run the query in MySQL. However, somehow the results could not be passed back to php and hence the error (caused by (!Result)). I tried to commit after inserting the new customer but it did not help.

// Create SQL statement to retrieve additions to CUSTOMER_ARTIST_INT table
$SQL = "SELECT * FROM CustomerInterestsView ";
$SQL .= "WHERE CustomerLastName = '$LastName' ";
$SQL .= "AND CustomerFirstName = '$FirstName'";


// Execute SQL statement

$Result = $PDOconnection->query($SQL);

// Test existence of $RecordSet
if (!$Result)
{
exit ("SQL Statement Error: " . $SQL);
}

Options: ReplyQuote


Subject
Written By
Posted
March 14, 2018 12:22PM
March 14, 2018 03:39PM
Re: SQL error on php page
March 15, 2018 05:40PM
March 15, 2018 07:33PM
March 16, 2018 07:14PM
March 16, 2018 07:19PM
March 17, 2018 09:08AM
March 17, 2018 10:41AM
March 18, 2018 12:10PM
March 18, 2018 06:20PM
May 09, 2018 03:33AM


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.