Note that there are some explanatory texts on larger screens.

plurals
  1. POMy PHP code needs to display all rows; how can do this
    primarykey
    data
    text
    <p>Here is the website that shows my problem</p> <p><a href="http://teetimeqc.com/paypage.php" rel="nofollow">http://teetimeqc.com/paypage.php</a></p> <p>I want to show 1 entire row that EXACTLY matches the search query term on column 'cust_no'</p> <p>Other columns are 'prog_id', 'balance', 'cust5_id'</p> <p>So user searches for "140594", the entire <b>1</b>row displays along IF it's an exact match to the 'cust_no' of that row.</p> <p>So they see results like this:</p> <p>ID# Prog ID# Cust No# Balance #</p> <p><b> UPDATED CODE!</b></p> <p>Thanks so far jtherman for the help</p> <pre><code>&lt;code&gt; &lt;?php $db_host="***"; $db_username="****"; $db_password="****"; $db_name="***"; $db_tb_name="cust"; $db_tb_atr_name="cust_no"; $db_prog="prog_id"; $db_bal="balance"; mysql_connect("****","*******","*****"); mysql_select_db("db461563732"); $query=mysql_real_escape_string($_GET['query']); $query_for_result=mysql_query("SELECT * FROM $db_tb_name WHERE $db_tb_atr_name = '".$query."'"); echo "&lt;h2&gt;Search Results&lt;/h2&gt;"; while($data_fetch=mysql_fetch_array($query_for_result)) echo ($data_fetch[$db_tb_atr_name]); echo ($data_fetch[$db_prog]); mysql_close(); ?&gt; </code></pre> <p>Here's what the table looks like; Cust5_ID is not important, it's just an auto increment value I'm using as the primary key.....should I change the primary key to 'cust_no'?:</p> <pre><code>TABLE `cust` ( `cust5_id` Integer auto_increment primary key, `prog_id` Integer not null, `cust_no` Integer null, `balance` Decimal(12, 2) null ) DEFAULT CHARACTER SET utf8 ENGINE=InnoDB; INSERT INTO `cust` (`cust5_id`,`prog_id`,`cust_no`,`balance`) VALUES (1,217770,145094,-178.01), (2,219885,145113,-390.86), (3,219888,145164,-206.55), (4,226227,145279,0), (5,227700,145340,0), (6,219911,145344,0), (7,227795,145410,-44.1); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload