Ezeran Posted March 28, 2007 Share Posted March 28, 2007 When I run this in M3GATE I'm not getting anything displayed, the database information is there. What have I done wrong? <?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='Ancient Hakkari Manslayer'"); $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['Name'] = mssql_fetch_array($SQL)) { echo ('Weapon Name: '.$row['Name'].' '); echo ('Damage: '.$row['minDamage' ].' '); echo ('Type: '.$row['type'].'<br>'); } ?> </p> </card> </wml> Link to comment https://forums.phpfreaks.com/topic/44678-not-getting-a-display/ Share on other sites More sharing options...
poirot Posted March 28, 2007 Share Posted March 28, 2007 There are some strange things in your code, but based on a quick look over it, this might work: REPLACE this line <?php while($row['Name'] = mssql_fetch_array($SQL)) WITH <?php while($row = mssql_fetch_array($SQL)) Also make sure your query actually returns valid rows. Link to comment https://forums.phpfreaks.com/topic/44678-not-getting-a-display/#findComment-216966 Share on other sites More sharing options...
Ezeran Posted March 28, 2007 Author Share Posted March 28, 2007 Right a quick check has shown that it isn;t runnign the loop, so the query must be empty, now to try and work out why, I know the text string is corrent as I copy pasted it from the database. And the database is still corrent (didn't cut instead of copy etc). Thanks for the help so far. EDIT: I changed $SQL = mssql_query("SELECT * FROM Weapons WHERE Name='$weapon'") to $SQL = mssql_query("SELECT * FROM Weapons"); and now I'm getting an error ln 10 col 14 expected end of tag 'br' Link to comment https://forums.phpfreaks.com/topic/44678-not-getting-a-display/#findComment-216970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.