Jump to content

edjbruner

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

edjbruner's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh crap!! Good eyes. That has to be the problem "Know thy own code" LOL
  2. Thanks, but I don't think it is my presentation code. Here it is: if (!$result) { die("I'm sorry we are currently improving STO to make it better: " . mysql_error()); } else { $num=mysql_numrows($result); $i=0; echo "<table border=1><th>Hits</th><th>NAME</th><th>STYLE</th><th>TOWN</th><th>DELIVER?</th><th>PID</th><th>PRODUCT</th><th>LG PRICE</th><th>SID</th><th>SPECIAL</th><th>PRICE</th>"; while ($i < $num) { $hits = mysql_result($result, $count, "hits"); $cid = mysql_result($result, $count, "cid"); $name = mysql_result($result, $count, "name"); $style = mysql_result($result, $count, "style"); $town = mysql_result($result, $count, "town"); $deliver = mysql_result($result, $count, "deliver"); $pid = mysql_result($result, $count, "pid"); $pname = mysql_result($result, $count, "pname"); $lgprice = mysql_result($result, $count, "lgprice"); $sid = mysql_result($result, $count, "sid"); $sname = mysql_result($result, $count, "sname"); $sprice = mysql_result($result, $count, "sprice"); echo "<tr><td>$hits<td>$name<td>$style<td>$town<td>$deliver<td>$pid<td>$pname<td>$lgprice<td>$sid<td>$sname<td>$sprice</tr>"; $i++; } echo "</table>"; } The query's results gets pasted to the method above. Thanks for looking.
  3. In case you are interested, here is the exact output from MYSQL: mysql> SELECT DISTINCT c.hits, c.cid, c.name, c.style, c.town, c.deliver, m.pid, m.pname, m.lgprice, s.sid, s.sname, s.sprice FROM customers AS c, menus AS m, specials AS s WHERE m.cid=2 ORDER BY c.hits; +------+-----+-------------------------+---------+----------+---------+-----+--------------+---------+-----+------------------------+--------+ | hits | cid | name | style | town | deliver | pid | pname | lgprice | sid | sname | sprice | +------+-----+-------------------------+---------+----------+---------+-----+--------------+---------+-----+------------------------+--------+ | 0 | 3 | sals pizza | italian | palmyra | 1 | 1 | pizza | 8.99 | 1 | Cheese steak and Fries | 6 | | 0 | 4 | bruno italian restarant | italian | palmyra | 1 | 2 | cheese steak | 5.99 | 1 | Cheese steak and Fries | 6 | | 0 | 5 | dragon restarant | chinese | palmyra | 1 | 3 | french fries | 3.99 | 1 | Cheese steak and Fries | 6 | | 0 | 2 | vito pizza | italian | palmyra | 1 | 1 | pizza | 8.99 | 1 | Cheese steak and Fries | 6 | | 0 | 3 | sals pizza | italian | palmyra | 1 | 2 | cheese steak | 5.99 | 1 | Cheese steak and Fries | 6 | | 0 | 4 | bruno italian restarant | italian | palmyra | 1 | 3 | french fries | 3.99 | 1 | Cheese steak and Fries | 6 | | 0 | 6 | peking restarant | chinese | mt.holly | 1 | 1 | pizza | 8.99 | 1 | Cheese steak and Fries | 6 | | 0 | 2 | vito pizza | italian | palmyra | 1 | 2 | cheese steak | 5.99 | 1 | Cheese steak and Fries | 6 | | 0 | 3 | sals pizza | italian | palmyra | 1 | 3 | french fries | 3.99 | 1 | Cheese steak and Fries | 6 | | 0 | 5 | dragon restarant | chinese | palmyra | 1 | 1 | pizza | 8.99 | 1 | Cheese steak and Fries | 6 | | 0 | 6 | peking restarant | chinese | mt.holly | 1 | 2 | cheese steak | 5.99 | 1 | Cheese steak and Fries | 6 | | 0 | 2 | vito pizza | italian | palmyra | 1 | 3 | french fries | 3.99 | 1 | Cheese steak and Fries | 6 | | 0 | 4 | bruno italian restarant | italian | palmyra | 1 | 1 | pizza | 8.99 | 1 | Cheese steak and Fries | 6 | | 0 | 5 | dragon restarant | chinese | palmyra | 1 | 2 | cheese steak | 5.99 | 1 | Cheese steak and Fries | 6 | | 0 | 6 | peking restarant | chinese | mt.holly | 1 | 3 | french fries | 3.99 | 1 | Cheese steak and Fries | 6 | +------+-----+-------------------------+---------+----------+---------+-----+--------------+---------+-----+------------------------+--------+ 15 rows in set (0.00 sec)
  4. Thanks. The PHP file returns the following: Hits NAME STYLE TOWN DEL PRODUCT PRICE SPECIAL PRICE 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 0 sals pizza italian palmyra 1 pizza 8.99 Cheese steak and Fries 6 Basically, my menus table has 3 PRODUCTS for sals. The query from the PHP file gives me a ton of hits for the same menu entry. sals also has fries as a PRODUCT and Cheese steak. I've echo'ed out the query string to the screen and it appears normal. If PHP doesn't modify a query string, and you don't see any red flags in the query string, then I'm screwed. I'll have to come up with an alternative method. THanks for looking at this problem. I really appreciate it.
  5. When I log into MYSQL (via command line) and use the following query, I get a result set that I expect: SELECT DISTINCT c.hits, c.cid, c.name, c.style, c.town, c.deliver, m.pid, m.pname, m.lgprice, s.sid, s.sname, s.sprice FROM customers AS c, menus AS m, specials AS s WHERE m.cid=2 ORDER BY c.hits; In my PHP file, the query runs successfully, but produces a completely different erroneous result set: // 1.QUERY DB WITH INPUT $queryVendor = "SELECT DISTINCT c.hits, c.cid, c.name, c.style, c.town, c.deliver, m.pid, m.pname, m.lgprice, s.sid, s.sname, s.sprice FROM customers AS c, menus AS m, specials AS s WHERE m.cid=$id ORDER BY c.hits"; $result = mysql_query($queryVendor); Thanks, Please help. Does PHP interpret SQL queries and modify them when it sends them to MYSQL?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.