yeah...errora are important. I do not escape my quotation marks in a query. I use single quotes within my insert and select statements.
If it says "No valis MySQL resource then you are returning 0 records which may be caused by escaping the quotations.

I follow this pattern
$sql ="INSERT INTO <table> VALUES ('some value','another value','etc')";


        I am getting errors for the following queries.  This query seems
to work fine in phpMyAdmin.

$query2 = "SELECT AllMid_Data.CPU_Hostname FROM AllMid_Data, accounts
                   WHERE AllMid_Data.CPU_IN_SVC = \"Y\"
                   AND AllMid_Data.CPU_DNS = \"\"
                   AND accounts.sbcuid = $sbcuid
                   AND accounts.system = AllMid_Data.CPU_Hostname
                   AND accounts.ctime IS NULL
                   ORDER BY CPU_Hostname ASC";
$results2 = mysql_query($query2, $Prod) or die(mysql_error());
$system2 = mysql_fetch_assoc($results2);
$query3 = "SELECT AllMid_Data.CPU_Hostname FROM AllMid_Data, acct_db
                   WHERE AllMid_Data.CPU_IN_SVC = \"Y\"
                   AND AllMid_Data.CPU_DNS = \"\"
                   AND acct_db.key1 LIKE \"$sbcuid%\"
                   AND acct_db.key1 LIKE \"%\".AllMid_Data.CPU_Hostname
                   ORDER BY CPU_Hostname ASC";
$results3 = mysql_query($query3, $Prod) or die(mysql_error());
$system3 = mysql_fetch_assoc($results3);

        I am assuming that I have an issue with query3.  Thanks in
Scott Nipp
Phone:  (214) 858-1289
Web:  http:\\

-- PHP Database Mailing List ( To unsubscribe, visit:

Reply via email to