Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 11-09-2016, 09:06 PM   #1
alexwaston
Registered User
 
Join Date: Aug 2016
Posts: 4
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

Last edited by alexwaston; 12-02-2016 at 08:11 PM..
alexwaston is offline   Reply With Quote

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEO Update minddigital Google 9 06-22-2020 11:36 AM
0 Drop Magento Database in One Query sansastark Programming General 0 07-11-2016 06:26 PM
Windows Hosting on IIS 8 Server with Free SQL 2012 Database thewebhosting Web Promotion 1 04-04-2013 08:53 AM
Plastic Surgeons Database of United States (Phone, Address, Zip) immediate Post your ad here 0 05-09-2012 12:11 AM
ISO Country Codes and Area Codes Database with Population, Area and GDP immediate Post your ad here 0 02-03-2012 03:48 AM


All times are GMT -7. The time now is 08:57 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.