Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP with SQL issue

    I'm having an issue with my wml. I have a php query that is meant to pull some stuff out of my database. However it doesn't seem to be getting anything. Heres the Code

    Code:
    <?php header('Content-type: text/vnd.wap.wml');
    echo '<?xml version="1.0"?>'; ?>
    <?php 
    $weapon= $_GET['weap'];
    $Conn = mssql_connect ('STUDENT1X','sql0401445','B1r12-36')  or die('Could Not Connect to ODBC Database!');
    		$DB = mssql_select_db("sql0401445", $Conn);
    		$SQL = mssql_query("SELECT * FROM Weapons WHERE Name='$weapon'");
    		$row = mssql_fetch_array($SQL);
    mssql_close($Conn);
    ?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    
    
    <card id="card1"><p>
    <?php while($row = mssql_fetch_array($SQL))  
    { 
        echo ('Weapon Name: '.$row['Name'].'&nbsp;'); 
        echo ('Damage: '.$row['minDamage' ].'&nbsp;'); 
        echo ('Type: '.$row['type'].'<br>'); 
    }
    ?>
    </p>
    </card>
    </wml>
    I've run the same query in coldfusion with no issues, as well as swaping the $weapon for just the text.

    Also when I change$SQL = mssql_query("SELECT * FROM Weapons WHERE Name='$weapon'"); to $SQL = mssql_query("SELECT * FROM Weapons");
    It complains.

    Any idea whats up?

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    What is the error?


  •  

    Posting Permissions

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