Re: [PHP] Stumped I Tell You!
On Fri, Jul 25, 2008 at 3:41 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > I see you get whacked around the head here every so often...and if not > here I am sure that your SO handles it as needed. Yeah, but she's in Virginia Beach for the week, so there's a slight chance the bruising will fade. -- Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped I Tell You!
[snip]By the way, I didn't mean to insinuate that your use of the if() condition was incorrect[/snip] No worries. [snip] Someone needs to whack me upside the head every so often. In my case, that might be a patentable invention.[/snip] I see you get whacked around the head here every so often...and if not here I am sure that your SO handles it as needed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped I Tell You!
On 7/25/08, Daniel Brown <[EMAIL PROTECTED]> wrote: > > On Fri, Jul 25, 2008 at 3:07 PM, Jay Blanchard <[EMAIL PROTECTED]> > wrote: > > > > *slaps forehead soundly* I found that there was a missing greater than > > sign in a greater than or equal to requirement in an earlier query. > >The most minuscule errors cause the greatest harm. > >By the way, I didn't mean to insinuate that your use of the if() > condition was incorrect, though I admit that, re-reading it, it > absolutely sounds that way. I just meant that it was my preferred > method. I also realized that I jumped the gun on the "Send" button > before sending the contents of the second message I sent. Someone > needs to whack me upside the head every so often. In my case, that > might be a patentable invention. Already patented. It's called "The Spouse". --David.
Re: [PHP] Stumped I Tell You!
On Fri, Jul 25, 2008 at 3:07 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > *slaps forehead soundly* I found that there was a missing greater than > sign in a greater than or equal to requirement in an earlier query. The most minuscule errors cause the greatest harm. By the way, I didn't mean to insinuate that your use of the if() condition was incorrect, though I admit that, re-reading it, it absolutely sounds that way. I just meant that it was my preferred method. I also realized that I jumped the gun on the "Send" button before sending the contents of the second message I sent. Someone needs to whack me upside the head every so often. In my case, that might be a patentable invention. -- Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped I Tell You!
[snip] I'm sure you've already tried this, but did you copy the SQL query echo'd out and try it directly with MySQL to make sure there are rows returned? [/snip] Yes. *slaps forehead soundly* I found that there was a missing greater than sign in a greater than or equal to requirement in an earlier query. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped I Tell You!
On Fri, Jul 25, 2008 at 2:36 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > I have several other queries running in this example and they all use > the same run/error check routine with no issues. I'm sure you've already tried this, but did you copy the SQL query echo'd out and try it directly with MySQL to make sure there are rows returned? -- Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped I Tell You!
[snip] [snip!] > > $endBal = mysql_fetch_array($dbEnd); > echo mysql_num_rows($dbEnd); > print_r($endBal); > > Nothing gets returned from those last statements. Am I missing something > completely? Right here You're merging assignment. Maybe you meant this: [/snip] I have several other queries running in this example and they all use the same run/error check routine with no issues. This has always worked in the past. It is like saying if(!$theFile = fopen('myfile.txt', 'a')) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped I Tell You!
On Fri, Jul 25, 2008 at 1:55 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip!] > > $endBal = mysql_fetch_array($dbEnd); > echo mysql_num_rows($dbEnd); > print_r($endBal); > > Nothing gets returned from those last statements. Am I missing something > completely? Right here You're merging assignment. Maybe you meant this: Or you could do it like I do: -- Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stumped I Tell You!
$getEnd = "select a.ACCOUNTID as CONTRACT, a.BALANCE/1 as BALANCE, b.STATUS, b.IMSI_ID as MDN, b.IMEI_ID as ESN, "; $getEnd .= "b.EQUIP_ID as MIN, b.MKT, b.MARKET_NAME "; $getEnd .= "FROM work.account_".$startDate." a "; $getEnd .= "JOIN work.customer_".$startDate." b "; $getEnd .= "ON ( b.CONTRACT_ID = a.ACCOUNTID AND b.RUNDATE = date_sub(a.BC_ACCOUNT_ARC_DATE, interval 1 day)) "; $getEnd .= "WHERE a.BC_ACCOUNT_ARC_DATE = str_to_date('".$endDate."','%Y%m%d') "; $getEnd .= "AND a.ACCOUNTID = '".$acct['CONTRACT']."' "; $getEnd .= "AND a.status = 1 "; $getEnd .= "AND a.balance > 0 "; if(!$dbEnd = (mysql_query($getEnd, $dbc))){ echo mysql_error() . "\n"; exit(); } echo $getEnd; returns select a.ACCOUNTID as CONTRACT, a.BALANCE/1 as BALANCE, b.STATUS, b.IMSI_ID as MDN, b.IMEI_ID as ESN, b.EQUIP_ID as MIN, b.MKT, b.MARKET_NAME FROM work.account_20080601 a JOIN work.customer_20080601 b ON ( b.CONTRACT_ID = a.ACCOUNTID AND b.RUNDATE = date_sub(a.BC_ACCOUNT_ARC_DATE, interval 1 day)) WHERE a.BC_ACCOUNT_ARC_DATE = str_to_date('20080602','%Y%m%d') AND a.ACCOUNTID = '180' AND a.status = 1 AND a.balance > 0 ...which works from the command line. $endBal = mysql_fetch_array($dbEnd); echo mysql_num_rows($dbEnd); print_r($endBal); Nothing gets returned from those last statements. Am I missing something completely? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php