mardi 21 juin 2016

Trying to Call Specific Rows MySql [duplicate]

This question already has an answer here:

I am trying to call specific rows from one table with links such as:

<a href="http://www.southfloridacoastalproperty.com/fusioncharts/sqftchart-db-2col-test-link.php?zip_ref=c33004">
    33004
</a>
<br>
<a href="http://www.southfloridacoastalproperty.com/fusioncharts/sqftchart-db-2col-test-link.php?zip_ref=c33009">
    33009
</a>
<br>

The column name is zip_ref and I'm trying to just display rows of a certain zip code, for instance 33004.

But when I try any of my links I get the following error:

Error code (1054): Unknown column 'c33004' in 'where clause'

But my where clause is defining the column zip_ref isn't it and isn't = c33004 searching for any values under that column??

$zip_ref = mysqli_real_escape_string($dbhandle, $_GET["zip_ref"]);
$strQuery = "SELECT id, zip_code, zip_ref, year, price_avg_sold, price_sqft, pct_list_sold, adom, sold_nu, sold_chg, year_1, year_2, year_3, year_4, year_5, year_6, year_7, year_8, year_9, year_10
             FROM zip_code_data
             WHERE zip_ref = ". $zip_ref ."
             ORDER BY year ASC";

Aucun commentaire:

Enregistrer un commentaire