PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 13th, 2002, 10:24 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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?


Reply With Quote
  #2  
Old November 14th, 2002, 12:05 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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...

Reply With Quote
  #3  
Old November 14th, 2002, 12:36 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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?


Reply With Quote
  #4  
Old November 14th, 2002, 08:02 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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...

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > creating tables for mysql database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway