|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
creating tables for mysql database
<html><head>
<title>CCSHop Installation</title> </head> <body bgcolor=#EEEEEE text=#000000> <?php require('../config.php'); $DropStr = "DROP TABLE products"; $CreateStr = "CREATE TABLE products ( " . " id int(11) NOT NULL auto_increment, " . " item_name varchar(128) DEFAULT '' NOT NULL, " . " item_desc Blob DEFAULT '' NOT NULL, " . " item_price decimal(10,2) DEFAULT '0' NOT NULL, " . " cat_id int(11) DEFAULT '0' NOT NULL, " . " featured varchar(128) DEFAULT '' NOT NULL, " . " image varchar(250) DEFAULT '' NOT NULL, " . " PRIMARY KEY (id))"; $ResultDrop = @MySQL($database,$DropStr); $ResultCreate = MySQL($database,$CreateStr); $DropStr1 = "DROP TABLE categories"; $CreateStr1 = "CREATE TABLE categories ( " . " id int(11) NOT NULL auto_increment, " . " cat_id int(11) DEFAULT '0' NOT NULL, " . " name varchar(70) DEFAULT '' NOT NULL, " . " PRIMARY KEY (id))"; $ResultDrop1 = @MySQL($database,$DropStr13); $ResultCreate1 = MySQL($database,$CreateStr); ECHO "<center><font size=4>Your DONE!</font><BR>"; echo "Now open your Readme file if you haven't already and follow directions from there!"; ?> the above code is for makeing tables in a mysql database. before it only had the one for products, then i added the categories. worked fine when it was just products, but with categories it dont want to work,,,, I get this warning: Warning: mysql is deprecated; use mysql_select_db() and mysql_query() instead in c:apachehtdocsccshopinstallcreatetables.php on line 18 Warning: mysql is deprecated; use mysql_select_db() and mysql_query() instead in c:apachehtdocsccshopinstallcreatetables.php on line 27 what do i need to do, put categories in a new php page, and put a next button on this page? |
|
#2
|
|||
|
|||
|
RE: creating tables for mysql database
this is not an error, this is just a worning, telling you to use mysql_query() function instead an old one mysql().
you probably changed php version soon, and in this new version, old function is deprecated. anyway, this code should create tables. check with mysql client or phpMyAdmin. and basicly, just change name of the function if you don't want to get this warning anymore... |
|
#3
|
|||
|
|||
|
RE: creating tables for mysql database
hmm,,,,
well i did that, and now i get thiw warning Warning: Supplied argument is not a valid MySQL-Link resource in c:apachehtdocsccshopinstallcreatetables.php on line 19 Warning: Supplied argument is not a valid MySQL-Link resource in c:apachehtdocsccshopinstallcreatetables.php on line 28 how do you mean check with mysql or phpmyadmin, you mean documentation? |
|
#4
|
|||
|
|||
|
RE: creating tables for mysql database
sorry, my bad. i should look closer...
instead mysql($db, $query); new format is mysql_query($query); about chacking with mysql or phpMA, i was thinking to check with some software (mysql client) to see if tables are created... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > creating tables for mysql database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|