Updating database using php Adult live stream webcam


11-Oct-2015 08:04

This makes it much more effective for an update script.

$query = "UPDATE contacts SET first = '$ud_first', last = '$ud_last', phone = '$ud_phone', mobile = '$ud_mobile', fax = '$ud_fax', email = '$ud_email', web = '$ud_web' WHERE id = '$ud_id'"; This query tells the database to update the contacts table where the ID is the same as the value stored in $ud_id (which as you can see from the form on the previous page was set as the id of the record we are updating) and to set the following fields to the specified values (which were set using the form on the previous page).

$id=$_GET['id']; $username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password); $query=" SELECT * FROM contacts WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i As you can see, this code will output a standard form, but instead of having blank boxes like on the form for inserting a new record, this one already has the current information from the database inserted into it.Using this you can then create the update script, which will actually have two sections to it.The first part of the update script uses the single record selection from last week but adds a little HTML to it to make it more useful.Last week I explained how to create a link for each record to point to your update script.

By using the $id variable you output links which would pass the correct ID to the script so that it can update the database.Since we will be using PHP scripting language to save an image to the server therefore in the "form-action" attribute we will use file with ".php" extension.