Re: [PHP] Parsing a string
Yes... you can use the explode function. Example: if $item where "Hello,There", $parts[0] would = "Hello" and $parts[1] would = "There". Thanks, Mike Ridinger On Fri, 23 Feb 2001, Todd Cary wrote: > I have a comma delimited string that I need to parse into an array. Is > there a PHP function that will do that ? > > Many thanks.. > > Todd > > -- > Todd Cary > Ariste Software > [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] Undefinded Index on Mysql Result under Win98/PWS
Check your php.ini file. The line for error report is set to E_ALL by default. Change it to E_PARSE so that minor errors (like the one you mentioned) aren't reported to the screen. Thanks. On Fri, 23 Feb 2001, Greg Kopp wrote: > I am using PHP4 + MySQL + PWS + Windows 98. > > We are trying to port over a web site to a laptop for remote use. > > However, when we execute a SQL query on a DB in which a filed of the record > contains a NULL value, we get an error. > > The code is as follows: > > $GetQuery = mysql_query ("SELECT * FROM ApplicantsTbl WHERE App_ID = $qq"); > $AppResult = mysql_fetch_array ($GetQuery); > $AppDOB = $AppResult[AppDOB]; > > The query executes just fine, and PARTS of the $AppResult array get > returned. However... > > We are experiencing TWO problems: > > First, unless we put quote marks around the index so it reads > $AppResult['AppDOB'], we get an undefined constant. This doesn't happen on > our Linux/Apache web server. > > Second, if the field AppDOB contains a NULL value, PHP barks that there is > an undefined index. It appears that it won't even create the index. > > I would appreciate any help you could be. > > Greg > > > -- 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] Generate Random Letters?
You could use: select char(rand(128)); Will dispaly character with ascii value of 0 - 128. Thanks, Michael Ridinger On Fri, 9 Mar 2001 [EMAIL PROTECTED] wrote: > I know it is possible to generate a random number using rand() I don`t > suppose there is anyway to generate a random letter sequence that anyone > knows of? > > Ade > > -- 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] Script to convert # of seconds to HH:mm
How about something like this: $secs = number of seconds; $hours = intval($secs/360); $minutes = intval(($secs-$hours*360)/60) $seconds = $secs - $hours*360 - $minutes * 60; Hope this helps. Michael Ridinger On Mon, 19 Mar 2001, Yoshi Melrose wrote: > Can someone direct me or send me a script that will convert number of > seconds into a format readable as HH:mm? I've tried making it myself, but it > gets all messed up in the calculations. Thanks > > Yoshi > > > -- 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] No php.ini?
You should look in one of the following areas: /etc /etc/httpd /etc/httpd/conf /user/local You may also want to use the locate instead of find. locate php.ini should do it. Michael Ridinger On Wed, 28 Mar 2001, Zhu George-CZZ010 wrote: > Someone else installed the PHP4.0.4, but I couldn't find the php.ini anywhere (I >used "find" command to search the whole box), however, the PHP is working fine. Is it >possible that the PHP can still work without php.ini? > > > Thanks. > > -- 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] get value
$data=mysql_fetch_row($result); $count=$data[0]; That's it! On Mon, 6 Aug 2001, Jeremy Morano wrote: > hi,,, > > can someone tell me how to access the value of count? please? > > - > $db = @mysql_select_db($db_name, $connection) or die("Couldn't select > database."); > > $sql = "SELECT count(*) > FROM $table_name, company > Where company.uid = user.companyUid and company.company = '$PHP_AUTH_USER' > "; > > $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); > > -- > > > > -- 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] How is this done?
Being the golf enthusiast I am, I'm always visiting a few interesting golf stie. The one I visit most is www.golfinohio.com. They have a rotating banner ad at the top of their page, but, as I view the source of the page, I notice that it displays one image on some banners, two or three on other banners, etc. I know why this would have to be done, but how is this accomplished? Would you use a database to store all the links? I would like to build a page of my own with banner ads. Thank you, Michael -- 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]