| |
Welcome to the dBforums forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor here for ContentLink opt out.
|
 |

10-21-08, 07:16
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 3
|
|
Need to save inputs in my databse
I have a website which i currently am publishing on siteground.com
I am trying to save details of users and other important information to the database. How can i like it to mySQL ???
I have an SQL on the same site so i dont need to upload it i guess but i really cant find out how to link them together
Please help
|
|

10-21-08, 07:47
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
would you repeat the question please?
"How can i like it to mySQL ???"
also, what does "I have an SQL on the same site" mean?
are you trying to say microsoft sql server?
|
|

10-22-08, 12:46
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 3
|
|
oh sorry... i meant i need to link what the input boxex to the database so when they press save or submit it will go directly to the database. On the site im building my website i have mySQL and i have created a table and everything .. soooo please help me out im stuck !!!
|
|

10-22-08, 14:12
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
what programming language are you using? php?
|
|

10-25-08, 20:53
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 3
|
|
yes on the website im creating it on it says php .. its really confusing for me
i only know how to use html so im really new to sql
thanks for replying
|
|

10-25-08, 21:19
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
okay, i'll move this thread to the php forum, and i trust the guys over there will be able to get you started

|
|

10-26-08, 07:33
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 5,444
|
|
In PHP everythign is doen using whats called scripts, a script is basically a series of commands which are interpreted at the server.
to do what you want you need a script to generate the html which requests the user input, and you need a script to check that input is ok and write good values to the db, or re-direct the user to the input form to remove any errors.
Teaching iyou how to write PHP, and HTML is beyond the scope of this site, we can and do help with specific problems, primarily how to interat with databases. there are some good rsources out the such as php.net and w3schools.com
HTH
__________________
Warning
May! contain traces of NUT. people with NUT allergies should not pay attention to any of the above
|
|

12-27-08, 09:10
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 2
|
|
$sql = sprintf("UPDATE `ur table name` SET `blah`='$_POST['blah']' WHERE `userid`='$_POST['userid']'");
mysql_query($sql);
or
$sql = sprintf("INSERT INTO `ur table name` blah blah blah ect if u know what i mean");
mysql_query($sql);
|
|

12-27-08, 12:52
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
roro1989, try this.
It is a complete script. This should at least get you started.
Taken from: http://www.w3schools.com/PHP/php_mysql_insert.asp
PHP Code:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Peter', 'Griffin', '35')");
mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Glenn', 'Quagmire', '33')");
mysql_close($con);
?>
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|