Jump to content

JapaneseRedhead

Members
  • Posts

    6
  • Joined

  • Last visited

JapaneseRedhead's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you all for your warnings. I've taken the page down.
  2. Oh, IC. I understand. Does this issue sound familiar at all? that the command works from phpmyadmin and Terminal but not from the website? Here is my code that I attached earlier. HTML: <!DOCTYPE html> <html> <head> <title>English Assessment Test - 3J-Network</title> </head> <body><table align="center"><tr><td width="610"> <table><tr> <td> <p><form action="scripts/run_query.php" method="POST"> <fieldset> <textarea id="query_text" name="query" cols="65" rows="8"></textarea> </fieldset> <br /> <fieldset class="center"> <input type="submit" value="Run Query"> <input type="reset" value="Clear and Restart" /> </fieldset> </form></p> </td> </tr></table> </td></tr></table></body> </html> PHP: <?php require '/homepages/9/d445176724/htdocs/firhavenacademy/scripts/app_config.php'; require '/homepages/9/d445176724/htdocs/firhavenacademy/scripts/database_connection.php'; $query = $_REQUEST['query']; $result = mysql_query($query); if (!$result) { die("<p>Error: " . mysql_error() . "</p>"); } else { mysql_query($query); echo "<ul>"; while ($row = mysql_fetch_row($result)) { echo "<li>{$row[0]}</li>"; } echo "</ul>"; } ?> Thanks for your help so far.
  3. Unfortunately it does not. Would somebody mind going to my website (http://3j-network.com/testQueryRunner.html) and putting in the command INSERT INTO test VALUES ("hello"); and seeing what happens? Perhaps someone can find a solution that way...
  4. I checked out the database_connection.php, and the input is still up-to-date. That the SELECT command works makes me think that this is not the issue. The error that is returned when I give the INSERT command is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"hello\")' at line 1 I don't know what to make of it, since this error doesn't appear at other times...
  5. No, I don't. The interesting fact, however, is that this command does work from Terminal and phpmyadmin. Perhaps I'm missing something, but doesn't that mean that there is nothing wrong the way I've set up the database, but rather with the code? Thanks for your help.
  6. Hello PHP Freaks, I've been trying to run this command from my website, but it always returns aan error, although it works on the phpmyadmin and on Terminal. So there must be something wrong with my code, I think. This is the command: INSERT INTO test VALUES ("hello"); My HTML and PHP documents are attachted. Can anyone see what is wrong? Thanks testQueryRunner.html run_query.php
×
×
  • 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.