Jump to content


This topic is now archived and is closed to further replies.


Not sure if its an SQL problem or PHP

Recommended Posts

Alright so I have a script that i have made to manage a store.. It\'s reading fine from the DB, but not writing to it for some reason, I am pretty posative nothing is wrong with the PHP, if you wanna check that out go to www.liquiddesignz.com/str.phps .. the SQL I used is:



id tinyint(4) NOT NULL auto_increment,

datetime varchar(100) NOT NULL default \'\',

name varchar(16) NOT NULL default \'\',

price varchar(32) NOT NULL default \'\',

descsmall tinyint(150) NOT NULL default \'\',

desclarge varchar(200) NOT NULL default \'0\',

sec tinyint(10) NOT NULL default \'0\',


KEY id (id)



This is really startin to agrivate me lol, thanks alot for any help


- Dh

Share this post

Link to post
Share on other sites

$insert = "INSERT INTO store(name, price, descsmall, desclarge, date, id) VALUES(\'$name\', \'$price\', \'$descsmall\', \'$desclarge\', \'$date\', \'$id\')";


$mysql_insert = mysql_query($insert)

           or die("Error! Unable to connect to the database!");



$mysql_link ->>> Were is this declared u can leave it blacnk as it will poin to the default open connection

Share this post

Link to post
Share on other sites

That is defined within the config file, guess I should have shown that as well, my bad, but here is the config file:



// - Login MySql -

$server = "localhost";

$sqluser = "****";

$sqlpass = "****";

$db = "ecom";

$mysql_link = mysql_pconnect("$server", "$sqluser", "$sqlpass")

              or die("Unable to connect to MySQL server");

mysql_select_db("$db") or die( "It\'s connecting to the MySQL server, but unable to select database");


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.