alarik149 Posted March 7, 2006 Share Posted March 7, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/4328-inserting-information-into-a-database/ Share on other sites More sharing options...
wickning1 Posted March 7, 2006 Share Posted March 7, 2006 [code]<?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";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4328-inserting-information-into-a-database/#findComment-15054 Share on other sites More sharing options...
alarik149 Posted March 7, 2006 Author Share Posted March 7, 2006 omg..it works...thank you so so much :) you guys are really great:) Quote Link to comment https://forums.phpfreaks.com/topic/4328-inserting-information-into-a-database/#findComment-15065 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.