So then I try do this â> I'm not sure why PHP doesn't return some kind of an error message.
<?php if ($fk_phone != NULL) { $sqlwrk = "SELECT `pk_phone_reports`, SUM(`calls`) AS `total_calls`, `date`, `calls` , `fk_ph_num` FROM `phone_reports`"; $sqlwrk .= " WHERE `pk_phone_number` = " . $fk_phoneâ; $rswrk = mysql_query($sqlwrk); if ($rswrk && $rowwrk = mysql_fetch_array($rswrk)) { echo $rowwrk["number"]; } @mysql_free_result($rswrk); } ?>
Note that this shouldnât work since it isnât a valid SQL statement.
PHP does return an error message, you're just not displaying it.
$rswrk = mysql_query($sqlwrk) or die(mysql_error());
$sqlwrk .= " WHERE (`pk_phone_number` = " . $fk_phoneâ) AND> (`date` BETWEEN â'$my_startdate'â AND â'$my_enddate'â)â;
Which brings me to my lovely parse error "Parse error:
You're not concatinating your string correctly.
$sqlwrk .= " WHERE (`pk_phone_number` = " . $fk_phone . ") AND (`date` BETWEEN '" . $my_startdate . "' AND '" . $my_enddate . "')";
or
$sqlwrk .= " WHERE (`pk_phone_number` = $fk_phone) AND (`date` BETWEEN '$my_startdate' AND '$my_enddate')";
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals â www.phparch.com
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php