Re: [PHP] Get PHP Configuration
> How would you get the current PHP configuration information, > more specifically, the exact command line used at compilation? Check the output of phpinfo(). -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] If Statement with more than one conclusion
Switch statements work well for these situations as well. They might be faster than checking for the item in a list from an array since an array must be created and searched through. General programming tip: your method *definitely* wouldn't work. The or operator has precendence over the == operator, causing those clauses to be broken up like this: $ext=="com" "net" "org" "info" Only one of those statements needs to be evaluated to true for the contents of the if statement to be evaluated. The first one will only be true if that's what's inside $ext. The others will always evaluate to true since a string of anything is considered "true" as a boolean. As a switch: > If($ext=="com"or"net"or"org"or"info"){ > Then do this > } switch($ext) { case "com": case "net": case "org": case "info": // then do this break; } Your friendly PHP manual will give you more information on the use of switches. They're useful for more than just this kind of situation (namely when you want to process many possible inputs for one variable). -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL error... but it works!!??
> Does anyone have any idea why this is giving me a "Warning: Supplied > argument is not a valid MySQL result resource in..." error? You'll have to give more code, which line you get that error from, etc., to give us a better idea why it's "not working." However, a quick tip: > $crdate = date("Y-m-d"); > $result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate' > AND status = 'T'"); These two lines can be condensed since MySQL has a built-in function to get the current time/date: SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T' -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fw: [PHP] MySQL error... but it works!!??
- Original Message - From: "Bas van Rooijen" <[EMAIL PROTECTED]> To: "Adam Baratz" <[EMAIL PROTECTED]> Sent: Saturday, January 05, 2002 4:39 PM Subject: Re: [PHP] MySQL error... but it works!!?? > > maybe try: > > if (!$result) > { >echo(mysql_error()); > } > > bvr. > On Sat, 5 Jan 2002 15:55:39 -0500, Adam Baratz wrote: > > >> Does anyone have any idea why this is giving me a "Warning: Supplied > >> argument is not a valid MySQL result resource in..." error? > > > >You'll have to give more code, which line you get that error from, etc., to > >give us a better idea why it's "not working." > > > >However, a quick tip: > > > >> $crdate = date("Y-m-d"); > >> $result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate' > >> AND status = 'T'"); > > > >These two lines can be condensed since MySQL has a built-in function to get > >the current time/date: > > > >SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T' > > > >-Adam > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] POSTing HTML into a database
> Does anyone know, by the way, if there's a port of PostreSQL to Windows > 2000? Or can I run it in Cygwin? I've seen it in the package list for Cygwin, there may be a full port as well, check Postgres' web site. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Parsing Database Text
> Is it possible to have PHP parse text queried from > a database (security issues notwithstanding)? > If so, how? Yes. Pull out the text with your method of choice and then use the eval function passing it the string of text to parse as its only parameter. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]