Results 1 to 10 of 10
Threaded View
-
13th Jan 2012, 11:42 AM #1OPBannedWebsite's:
CloudNXT.netMySQL insert using PHP Help
PHP Code:<?php
$con = mysql_connect("localhost","MYSQL USERNAME","MYSQL PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("seedvps_whm", $con);
$sql="INSERT INTO tblcustomaddon location, status, username, password, ip);
VALUES
('$_POST[location]','$_POST[status]','$_POST[username]','$_POST[password]','$_POST[ip]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
Code:<html> <body> <form action="insert.php" method="post"> Location: <input type="text" name="location" /> Status: <input type="text" name="status" /> Username: <input type="text" name="username" /> Password: <input type="text" name="password" /> IP: <input type="text" name="ip" /> <input type="submit" /> </form> </body> </html>
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'location, status, username, password, ip) VALUES ('fr','jaja','BigBoSs','kaka'' at line 1EnCiPh3r Reviewed by EnCiPh3r on . MySQL insert using PHP Help <?php $con = mysql_connect("localhost","MYSQL USERNAME","MYSQL PASS"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("seedvps_whm", $con); $sql="INSERT INTO tblcustomaddon location, status, username, password, ip); Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Where can I insert this code?
By Divvy in forum WordpressReplies: 7Last Post: 21st Oct 2011, 10:29 AM -
insert PSD file
By iobit in forum vBulletinReplies: 10Last Post: 9th Aug 2011, 08:38 AM -
insert 100 urls to database in one go ?
By jack3r in forum Web Application/Script SupportReplies: 2Last Post: 8th Jul 2011, 10:09 PM -
Insert Image Code
By warezboy in forum vBulletinReplies: 12Last Post: 9th Jun 2010, 06:16 PM -
Insert Image CODE
By tom247 in forum Web Application/Script SupportReplies: 3Last Post: 9th Jun 2010, 05:04 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...