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.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Need to save inputs in my databse

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-08, 07:16
roro1989 roro1989 is offline
Registered User
 
Join Date: Oct 2008
Posts: 3
Question 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
Reply With Quote
  #2 (permalink)  
Old 10-21-08, 07:47
r937 r937 is offline
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?
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #3 (permalink)  
Old 10-22-08, 12:46
roro1989 roro1989 is offline
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 !!!
Reply With Quote
  #4 (permalink)  
Old 10-22-08, 14:12
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
what programming language are you using? php?
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #5 (permalink)  
Old 10-25-08, 20:53
roro1989 roro1989 is offline
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
Reply With Quote
  #6 (permalink)  
Old 10-25-08, 21:19
r937 r937 is offline
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

__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #7 (permalink)  
Old 10-26-08, 07:33
healdem healdem is offline
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
Reply With Quote
  #8 (permalink)  
Old 12-27-08, 09:10
Crazy-T Crazy-T is offline
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);
Reply With Quote
  #9 (permalink)  
Old 12-27-08, 12:52
Frunkie Frunkie is offline
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On