Jump to content

dennisgreenwood48

New Members
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dennisgreenwood48's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Have tried the 'typical code for a prepared query' and while it shows no errors, all I get is a blank page. Thinking I needed some means of displaying the results I added an extra line, 'print_r ($rows)' but all this does is to display 'Array()' in the top left hand corner of the page and not the results of the 'SELECT' statement. I want the results to display in a table as the original code does. I don't know enough about php to make great changes in the code. The last time I did anything like this was over 15 years ago.
  2. The first piece of code, "screenshot_1", works perfectly but of course is open to SQL injection. If I use prepared statements as per "screenshot_2", and change $result from $con->query($query) to $result= $query->execute()it doesn't work and gives the error, "Fatal error: Uncaught Error: Call to a member function fetch() on bool ". I have read somewhere that this is caused because the 'Select' statement has failed.I am amazed that three lines of code (copied from a php manual) has caused the whole issue to fail. Where have I gone wrong? ,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.