1

I'm getting errors now when i submit my form Why am I not seeing any results?

These are the error messages that I'm receiving. Not Sure why. These are the error messages that I'm receiving. Not Sure why.

( ! ) Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\1form.php on line 22
Call Stack
#   Time    Memory  Function    Location
1   0.0000  244864  {main}( )   ..\1form.php:0
2   0.0010  254352  mysql_query ( ) ..\1form.php:22

( ! ) Warning: mysql_result() expects at least 2 parameters, 1 given in C:\wamp\www\1form.php on line 25
Call Stack
#   Time    Memory  Function    Location
1   0.0000  244864  {main}( )   ..\1form.php:0
2   0.0120  262464  mysql_result ( )    ..\1form.php:25

:)

<html>
<head>

    <form method="post" action="1form.php">

    <label for="textfield">Nino ID:</label>
    <input type="text" name="ninoid" id="ninoid">
    <input type="submit" name="submit" id="submit" value="Submit">
  </form>
    <?php

if (isset($_POST['submit'])) {
    //connect to the database
    include ('connect.php'); 

    $ninoid = ($_POST['ninoid']);


    $query = "SELECT ninoid FROM nino WHERE ninoid = '$ninoid';";

    $result = mysql_query("SELECT ninoid FROM nino WHERE ninoid = '$ninoid';");


echo mysql_result($result);
}
    ?>
Anthony Sawah
  • 57
  • 1
  • 7
  • You're not executing the query. (If you did: [SQL bleeding](http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php)). - You fixed the `submitted` typo, but your input fields are outside of the `
    ` still.
    – mario Sep 01 '15 at 21:45
  • Lol wow, I fixed that. Thanks – Anthony Sawah Sep 01 '15 at 21:58
  • @mario can you take a look at the above error now? – Anthony Sawah Sep 01 '15 at 22:02
  • 2
    See the manual on [`mysql_query`](http://php.net/mysql_query) and [`mysql_result`](http://php.net/mysql_result). It explains both the deprecation, and the required parameter. – mario Sep 01 '15 at 22:03

0 Answers0