#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    12
    Rep 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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    114
    Rep Power
    15
    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 ...
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    12
    Rep 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!

Similar Threads

  1. Replies: 1
    Last Post: February 15th, 2004, 04:04 AM
  2. Replies: 1
    Last Post: February 15th, 2004, 03:45 AM
  3. tables get corrupted
    By 90coders in forum MySQL Help
    Replies: 1
    Last Post: December 5th, 2003, 06:23 AM
  4. Replies: 0
    Last Post: September 1st, 2003, 02:36 AM
  5. temporary tables, and copying records
    By brainfuelmedia in forum MySQL Help
    Replies: 0
    Last Post: July 31st, 2003, 06:01 PM

IMN logo majestic logo threadwatch logo seochat tools logo