View Full Version : PHP with SQL issue

03-29-2007, 01:55 PM
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

<?php header('Content-type: text/vnd.wap.wml');
echo '<?xml version="1.0"?>'; ?>
$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);
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<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>');

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?

03-29-2007, 03:34 PM
What is the error?