Dark-Hawk Posted May 25, 2003 Share Posted May 25, 2003 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: CREATE TABLE store ( 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\', PRIMARY KEY (id), KEY id (id) ) TYPE=MyISAM; This is really startin to agrivate me lol, thanks alot for any help - Dh Quote Link to comment https://forums.phpfreaks.com/topic/504-not-sure-if-its-an-sql-problem-or-php/ Share on other sites More sharing options...
shivabharat Posted May 26, 2003 Share Posted May 26, 2003 $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 Quote Link to comment https://forums.phpfreaks.com/topic/504-not-sure-if-its-an-sql-problem-or-php/#findComment-1702 Share on other sites More sharing options...
Dark-Hawk Posted May 26, 2003 Author Share Posted May 26, 2003 That is defined within the config file, guess I should have shown that as well, my bad, but here is the config file: <?php // - 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"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/504-not-sure-if-its-an-sql-problem-or-php/#findComment-1716 Share on other sites More sharing options...
Dark-Hawk Posted May 29, 2003 Author Share Posted May 29, 2003 Alright well I got the problem fixed, thanks alot for the help.. Quote Link to comment https://forums.phpfreaks.com/topic/504-not-sure-if-its-an-sql-problem-or-php/#findComment-1760 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.