Jump to content

Not sure if its an SQL problem or PHP


Dark-Hawk

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:

 

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

Link to comment
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
Link to comment
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:

 


<?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");

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.