All pastes #63266 Raw Edit

Untitled

public text v1 · immutable
#63266 ·published 2006-06-09 02:24 UTC
rendered paste body
function customerdb_getcountry(){
        $sql="SELECT DISTINCT code, FROM country ORDER BY code";
        $results=sql($sql, "getAll");
        return $results;

---------------------------------------------------------------------

//country
echo "<tr><td>\n";
echo "<a href=\"#\" class=\"info\">Country\n";
echo "<span>Country <font size=-1>(You must have a country tied to the account)</font></span></a>\n";
echo "</td><td>\n";
$countrys=customerdb_getcountry();
echo "&nbsp;&nbsp;<select name=\"country\" onchange=\"switchit_country(); return true;\">\n";
echo "<option value=\"\">";
foreach ($countrys as $s){
        echo "<option value=\"$country\"";
        if($country==$s) echo " SELECTED";
        echo ">$s</option>\n";
}
echo "</select>\n";
echo "</td></tr>\n";

------------------------------------------------------------------

SELECT DISTINCT code, FROM country ORDER BY code [nativecode=1064 ** You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM 
country ORDER BY code' at line 1]