Jump to content


Photo

inserting information into a database


  • Please log in to reply
2 replies to this topic

#1 alarik149

alarik149
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 07 March 2006 - 01:48 PM

I really need your help.I am trying for a few days to make a script work,I posted it here but still i did not recieved a specific answer to where my problem is.I wanna drop that whole script and instead I want to ask you to give me the script I need,it is just a few lines I think it`s the most basic think of any mySQL programer.
SO : I have a database named 'championships' with password '123' the host 'localhost' and a table named 'signups' with 3 fields 'id' 'username' and 'status' .
id is the keyframe with auto_increment.
I want to add into this database the row with this values :
3, for field 'id' ;
adrian, for field 'username;
pending,for field 'status';

It would mean EXTREMLY much to me if some1 told me exacly what to do.I am reading google and .pds for a few days now but I don`t manage to do this properly.The database works perfectly if I add the information from MyAdmin.
Please help me
Tired of math homework ? Just visit http://www.solvemymath.com for a free online math solver and calculator.
Videochat bucuresti studio -> http://www.GirlAddicts.com
About the adult video chat business -> www.girlplan.com

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 07 March 2006 - 01:54 PM

<?php
$db = mysql_connect('yourserver', 'yourusername', 'yourpassword');
mysql_select_db('championships', $db);
$result = mysql_query("INSERT INTO signups (id, username, status) VALUES (3,'adrian','pending')");
if ($result) echo "woohoo it worked!";
else echo "sorry buster";
?>


#3 alarik149

alarik149
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 07 March 2006 - 02:17 PM

omg..it works...thank you so so much :) you guys are really great:)
Tired of math homework ? Just visit http://www.solvemymath.com for a free online math solver and calculator.
Videochat bucuresti studio -> http://www.GirlAddicts.com
About the adult video chat business -> www.girlplan.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users