SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast XploreR's Avatar
    Join Date
    May 2001
    Location
    Singapore
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problems with quotes

    Hi all.

    I would like to seek help for my problem:

    Code:

    $platform = 'Playstation';
    $game = 'Ace Combat II';
    $table1 = 'PlaystationGames';
    $table2 = 'PlaystationCodes';

    $sql = "SELECT Id, Gid, Publisher, Developer FROM $table1 WHERE game='$game'";


    The above code works but i would like to use the $platform variable inside $table1 and $table2.

    I tried doing this but it dosen't work:


    $platform = 'Playstation';
    $game = 'Ace Combat II';
    $table1 = '$platformGames';
    $table2 = '$platformCodes';

    $sql = "SELECT Id, Gid, Publisher, Developer FROM $table1 WHERE game='$game'";


    Any help?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Try this:

    $table1 = $platform . 'Games';

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An excelent tutorial on strings and PHP
    http://www.zend.com/zend/tut/using-strings.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •