Re: [PHP] Coding Question

2004-12-13 Thread Justin French
On 07/12/2004, at 6:50 AM, Al wrote: Jason Wong wrote: On Monday 06 December 2004 14:19, Rory Browne wrote: If I'm not mistaken Al wanted to return something if the thing failed, without having to put it inside an if_block. I'm watching this with curiosity, because return is a language

Re: [PHP] Coding Question

2004-12-06 Thread Richard Lynch
Al wrote: I've searched the PHP manual and can't find an answer for this question I'd like to use the OR DIE construct; but instead of DIE I'd like to use RETURN FOO. I haven't found a way to do it. $string= file_get_contents($filename) OR die(Could not read file); $db_link=

Re: [PHP] Coding Question

2004-12-06 Thread Al
Jason Wong wrote: On Monday 06 December 2004 14:19, Rory Browne wrote: If I'm not mistaken Al wanted to return something if the thing failed, without having to put it inside an if_block. I'm watching this with curiosity, because return is a language construct, and not a function, or anything that

Re: [PHP] Coding Question

2004-12-06 Thread Richard Lynch
Al wrote: Essentially, I'm creating warning reports for my users, not code errors. The users can then email the warnings to our webmaster. Jason Wong wrote: On Monday 06 December 2004 14:19, Rory Browne wrote: $result = mysql_db_query($db,select count(*) from $table)

Re: [PHP] Coding Question

2004-12-06 Thread Al
Richard Lynch wrote: Al wrote: Essentially, I'm creating warning reports for my users, not code errors. The users can then email the warnings to our webmaster. Jason Wong wrote: On Monday 06 December 2004 14:19, Rory Browne wrote: $result = mysql_db_query($db,select count(*) from

[PHP] Coding Question

2004-12-05 Thread Al
I've searched the PHP manual and can't find an answer for this question I'd like to use the OR DIE construct; but instead of DIE I'd like to use RETURN FOO. I haven't found a way to do it. $string= file_get_contents($filename) OR die(Could not read file); $db_link= mysql_connect($host,

Re: [PHP] Coding Question

2004-12-05 Thread Ligaya Turmelle
snip $db_link= mysql_connect($host, $user, $pw) OR die(Could not connect: . mysql_error()); /snip try: $db_link= mysql_connect($host, $user, $pw); if (!$db_link){ // do whatever if there is something wrong } maybe try something like that with the file_get_contents also? Respectfully,

Re: [PHP] Coding Question

2004-12-05 Thread Rory Browne
If I'm not mistaken Al wanted to return something if the thing failed, without having to put it inside an if_block. I'm watching this with curiosity, because return is a language construct, and not a function, or anything that has a value. I could probably have said that better sober, and not at

Re: [PHP] Coding Question

2004-12-05 Thread Jason Wong
On Monday 06 December 2004 14:19, Rory Browne wrote: If I'm not mistaken Al wanted to return something if the thing failed, without having to put it inside an if_block. I'm watching this with curiosity, because return is a language construct, and not a function, or anything that has a value.

[PHP] Coding Question

2003-07-20 Thread Aaron Axelsen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I am currently trying to think of how I want to solve an issue, and im looking for some input. I have a page that will query information from a database and then properly display it on the screen. Now the thing I want to set up is the

Re: [PHP] Coding Question

2003-07-20 Thread Justin French
Retrieving the results can be LIMITed to X results starting at row Y using mysql's LIMIT function. Check the MySQL manual, but basically, this will limit the result to 10 rows, starting with row 5. SELECT name FROM customers LIMIT 5,10 By taking your values for the starting point and row

[PHP] PHP coding question

2001-04-06 Thread Rory O'Connor
I'm not a real programmer, so I am wondering if anyone can help me translate this psuedo-code into php code: if ($page_num is a multiple of 8) { do this } If you want to know what I'm trying to do... I have a left frame showing a recordset of 8 records at a time. the frame on

Re: [PHP] PHP coding question

2001-04-06 Thread Gustavo Vieira Goncalves Coelho Rios
Rory O'Connor wrote: I'm not a real programmer, so I am wondering if anyone can help me translate this psuedo-code into php code: if ($page_num is a multiple of 8) { do this } If you want to know what I'm trying to do... I have a left frame showing a recordset of

Re: [PHP] PHP coding question

2001-04-06 Thread andre
Try this : if($page_num % 8 == 0) { do this } or to make it a bit more obvious: if(($page_num % 8) == 0) { do this } This way the "if" statement is executed only when the remainder of $page_num divided by 8 is equal to zero, i.e. $page_num is a multiple of 8. if ($page_num is a