MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

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 Dev Shed Forums Sponsor:
  #1  
Old October 16th, 2000, 10:25 PM
sbwtxj sbwtxj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 12 sbwtxj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
I meet a question.
When i use PHP script to setup two temporary tables,
How to use PHP to fetch the table names?

For example:

$result1=mysql_query("create temporary table mytable1 select * from train_time where station_name='$station1'",$id_link);
$result2=mysql_query("create temporary table mytable2 select * from train_time where station_name='$station2'",$id_link);

But

mysql_query("select * from mytable1,mytable2 where mytable1.train_number=mytable2.train_number",$id_link);
No have result!!!

simple,mysql_query("select * from mytable1",$id_link);
NO have result.

So ,how to use the temporary table name by PHP?

shan baowei

Reply With Quote
  #2  
Old October 17th, 2000, 11:06 AM
billyo billyo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 114 billyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
If you're using mySQL 3.22.x you can't use select statements to create tables. That feature was added around 3.23.x. So, which version of MySQL are you using? If it's the older version, you have to use a regular style create table statement, and then you can do an INSERT INTO your_new_table SELECT ...

Reply With Quote
  #3  
Old October 17th, 2000, 07:46 PM
sbwtxj sbwtxj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 12 sbwtxj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I using the MySQL version is 3.23.21-beta for win95/win98 on i386.But my web server's is 3.22.32 for irix6.5 on SGI and Freebsd4.0 on i386.
Of course i develop it on localhost in windows,distribute it in my servers.

This question appears in windows.The version is higher than servers'.

I don't know.


Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > how to use temporary tables?


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 6 hosted by Hostway