0

Dear Sirs,

I would like to update some information in my MySQL through a PHP syntax, but it won't work. I'll show you my code.

 while($info = mysql_fetch_array( $data )) 
 { 

 if ($info['author'] === $user_data['username']) {
        print '<div class="registerleft">
        <form action="" method="post">
            <ul>
                <h2>A tulaj</h2>
                <li>
                    Vezeteknev<br>
                    <input type="text" name="first_name" value="'.$info[10].'">
                </li>
                <li>
                    Keresztnev<br>
                    <input type="text" name="last_name" value="'.$info[1].'">
                </li>
                <li>
                    Telefonszam<br>
                    <input type="text" name="number" value="'.$info['number'].'">
                </li>
                <li>
                    Kerulet<br>
                    <input type="text" name="district" value="'.$info['district'].'">
                </li>
                <li>
                    Utcanev<br>
                    <input type="text" name="street" value="'.$info['street'].'">
                </li>
                <li>
                 Hazszam<br>
                 <input type="text" name="house_number" value="'.$info['house_number'].'">
                </li></ul></div>
                <div class="registerright">
                <h2>A talalkozo</h2>
                <ul>
                <li>
                Talakozas datuma</br>
                <input type="date" name="appointment_date" value="'.$info[7].'">

                </li>
                <li>
                Talakozsas idopontja</br>
                <input type="time" name="appointment_time" value="'.$info['appointment_time'].'">

                </li>
                <li>
                Megjegyzes</br>
                <input type="text" name="comment" value="'.$info[9].'"/>
                </li>
                <li>
                Link</br>
                <input type="text" name="anchor" value="'.$info[10].'"/>

                </li>

        <select name="typee">
          <option value="fine">Fine</option>
          <option value="bad">Bad</option>
        </select>
                <li>
                <input type="submit" name="submit" value="Submit">
                </li>
            </ul>
        </form>
        </div>'; }

This is the code where I queried all the information into text inputs, in order to be easier for the "updaters" who will be updating the data. Now if they change something in the inputs, and click on Submit, the rows should be updated with this code:

 if($_POST['submit']) {
mysql_query("UPDATE `database`.`table` SET `first_name` = \'Something\' WHERE `table`.`id` = 17";);
}

Now this SQL syntax gives me an error. What would you use instead of this?
Thanks in advance!

Tibor

2
Contributors
1
Reply
14
Views
4 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.