Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   PHP / mySQL (http://siteownersforums.com/forumdisplay.php?f=10)
-   -   Database update query (http://siteownersforums.com/showthread.php?t=180202)

alexwaston 11-09-2016 09:06 PM

Database update query
 
HI.

Just a quick question.

I've created a form which has a drop down menu, and named the drop down menu, profile_country.
I've set the form up so that when I receives the correct entry from the database, it displays the data in the form.

All I like to ask is if a selection is chosen from the drop down, (ie from uk to usa for example),
how do I update the database as I can't get it to work.

I'd just like to ask if the correct syntax is used after sql, and after the update, do I use query or something else to complete the update?

$user_country = $_POST["profile_country"]; //Get the data from the form
$userID = $_POST["profile_ID"]; //Get the data from the form


$sql = "UPDATE phpbear_registration SET Country='$user_country' WHERE Member_id='$userID'";

//mysqli_select_db($db_databasename); // Try this line
mysqli_query($conn,$sql);
mysqli_close($conn);

Thank You.

--------------------------------------------------------------------------
Relax more: sms ringtone download, zedge ringtones, best ringtone download


All times are GMT -7. The time now is 09:41 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.