|
-
Mar 20th, 2002, 02:53 PM
#1
Thread Starter
Fanatic Member
mysql insert thingy wont work
PHP Code:
$link = mysql_connect("localhost", "fragblast", "mypass");
mysql_select_db("fragblast");
$sql = "insert into articles(name,email,gamename,system,link,ss1,ss2,ss3) values ('$name','$email','$gamename','$system','$path','$ss1','$ss2', '$ss3')";
$result = mysql_query($sql);
// Closing connection
mysql_close($link);
it doesnt give any errors, but when i check the table, theres nothing in there.
any ideas? im fairly new to mysql
thanks
Last edited by nabeels786; Mar 20th, 2002 at 03:05 PM.
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 28th, 2005, 11:37 PM
#2
PowerPoster
Re: mysql insert thingy wont work
 Originally Posted by nabeels786
PHP Code:
$link = mysql_connect("localhost", "fragblast", "mypass");
mysql_select_db("fragblast");
$sql = "insert into articles(name,email,gamename,system,link,ss1,ss2,ss3) values ('$name','$email','$gamename','$system','$path','$ss1','$ss2', '$ss3')";
$result = mysql_query($sql);
// Closing connection
mysql_close($link);
it doesnt give any errors, but when i check the table, theres nothing in there.
any ideas? im fairly new to mysql
thanks 
try this
PHP Code:
<?php
$server = "location_of_server_here";
$db_user = "database_username";
$db_pass = "database_password";
$database = "database_name";
$tablename = "database_table_name";
////NOTES
////
////IF YOUR FIRST INPUT FIELD NAME IS CALLED INPUTONE THEN
////$FORM_INPUT_FIELD_NAME_ONE WOULD BE SPECIFIED AS:
////$INPUTONE
$connection = mysql_connect("$server", "$db_user", "$db_pass");
$db = mysql_select_db("$database", $connection);
$query = "INSERT INTO $tablename (`DATABASE_COLUMN_NAME_ONE`,`DATABASE_COLUMN_NAME_TWO`) VALUES ('$FORM_INPUT_FIELD_NAME_ONE','$FORM_INPUT_FIELD_NAME_TWO')";
$result = mysql_query($query, $connection);
////PRINT A MESSAGE TO THE SCREEN TO SAY ADDITION SUCCESSFUL
echo "Yeah baby yeah! Addition Successful!";
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|