Re: [PHP] Variable as an index

2008-12-22 Thread Jochem Maas
MikeP schreef: > Hello, > I am trying to output the value of the following:($x is an int incremented > by a for statement. > echo " > >'$users[$x][U]' > "; > > I have tried putting the quotes all over and all I get is: > 'Array[U]'. > > What am I doing wrong. you need to help p

Re: [PHP] Replacing special characters with their HTML equivalents

2008-12-22 Thread Per Jessen
James Colannino wrote: > Hey everyone. I have a question. I have a web scraper that grabs > information from web pages that often contain characters such as > vowels with umlots (I know I spelled that wrong.) > > The data is editable, so the characters show up unmodified in an > editable text b

[PHP] Re: Variable as an index

2008-12-22 Thread MikeP
Nevermind, Got it. ""MikeP"" wrote in message news:3c.17.23981.6c8be...@pb1.pair.com... > Hello, > I am trying to output the value of the following:($x is an int incremented > by a for statement. >echo " > > '$users[$x][U]' >"; > > I have tried putting the quotes all over and all I

[PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
Hi, I seem to have a bug in my code but can't see why. My first record does not display when I run a search. Can anyone spot what I have done wrong? Thanks if (0 == $totalRows_rsSearch) { echo "Sorry no products were found"; } else { echo "Please click on a product for further information."; wh

Re: [PHP] First record not diplaying

2008-12-22 Thread Ashley Sheridan
On Mon, 2008-12-22 at 14:02 +, Gary Maddock-Greene wrote: > Hi, I seem to have a bug in my code but can't see why. My first record does > not display when I run a search. Can anyone spot what I have done wrong? > Thanks > > if (0 == $totalRows_rsSearch) { > echo "Sorry no products were found

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
Ash ... this is the full code block ... I am really new to php so I appreciate your tip Sorry no products were found"; } else { echo "Please click on a product for further information."; while ($row_rsSearch = mysql_fetch_assoc($rsSearch)){ echo " ". $row_rsSearch['product_name'].

Re: [PHP] First record not diplaying

2008-12-22 Thread HostWare Kft.
How do you know the record count for the query? SanTa - Original Message - From: "Gary Maddock-Greene" To: Sent: Monday, December 22, 2008 3:02 PM Subject: [PHP] First record not diplaying Hi, I seem to have a bug in my code but can't see why. My first record does not display when

Re: [PHP] First record not diplaying

2008-12-22 Thread Richard Heyes
> Also (and I know the speed junkies will want to shoot me now!) you could > shorten the echo inside the while loop to: You could shorten it even further by omitting it... :-) -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated December 20th) -- PH

Re: [PHP] eof bof in php

2008-12-22 Thread tedd
At 1:21 PM -0500 12/21/08, Anthony Gentile wrote: -snip exampe- is probably going to give you the result you want. However you should know it is bad practice to mix PHP and HTML as horridly as I just showed you. AKA you don't want your PHP writing your HTML. Anthony Gentile Anthony: Granted

Re: [PHP] First record not diplaying

2008-12-22 Thread Wolf
Gary Maddock-Greene wrote: > Hi, I seem to have a bug in my code but can't see why. My first record does > not display when I run a search. Can anyone spot what I have done wrong? > Thanks > > if (0 == $totalRows_rsSearch) { > echo "Sorry no products were found"; > } else { > echo "Please

Re: [PHP] First record not diplaying

2008-12-22 Thread Dan Shirah
> > // Good to go > > if (0 == $totalRows_rsSearch) { > echo "Sorry no products were found"; > } else { > echo "Please click on a product for further information."; > while ($row_rsSearch = mysql_fetch_assoc($rsSearch)){ > echo " $row_rsSearch['product_image']."\"> > >". $row_rsSearc

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
I know you are so right Richard .. beleive me ... I wish I was year down the line so I knew how to get the html out of the php -- - Gary Maddock-Greene ""Richard Heyes"" wrote in message news:af8726440812220617l6c965cd0x6ae55f57fa96b...@mail.gmail.com... Also (and I know the speed junkies wil

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
Very helpful thanks Wolf. fyi the web site you see was done by my son. This is a live project that I was just asking for help on ... a pointer perhaps. Too much to ask I guess -- - Gary Maddock-Greene "Wolf" wrote in message news:20081222141852.ovv8i.364383.r...@cdptpa-web15-z01... Gar

Re: [PHP] First record not diplaying

2008-12-22 Thread Ashley Sheridan
On Mon, 2008-12-22 at 14:14 +, Gary Maddock-Greene wrote: > Ash ... this is the full code block ... I am really new to php so I > appreciate your tip > > // Good to go > > if (0 == $totalRows_rsSearch) { > echo "Sorry no products were found"; > } else { > echo "Please click on a product fo

Re: [PHP] First record not diplaying

2008-12-22 Thread Dan Shirah
> > Hi, I seem to have a bug in my code but can't see why. My first record >>> does >>> not display when I run a search. Can anyone spot what I have done wrong? >>> Thanks >>> >>> if (0 == $totalRows_rsSearch) { >>> echo "Sorry no products were found"; >>> } else { >>> echo "Please click on a pro

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
Thanks Dan, So my error is here? $colname_rsSearch = "-1"; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_sondia_lighting, $sondia_lighting); $query_rsSearch = sprintf("SELECT * FROM products WHERE product_name LIKE %s", GetSQLValueStr

Re: [PHP] First record not diplaying

2008-12-22 Thread HostWare Kft.
Yes, the error is here. You get the record count with a mysql_fetch_assoc(), which reads the first record, and then step onto the next one. So the first record's datas will disappear at the next mysql_fetch_assoc() line (which can be found in your while loop). You should NOT fetch the first

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
very helpful thank you :) -- - Gary Maddock-Greene ""Sándor Tamás (HostWare Kft . )"" wrote in message news:dbb55d182b624f26be7f5125e592d...@stgepe... Yes, the error is here. You get the record count with a mysql_fetch_assoc(), which reads the first record, and then step onto the next one. S

Re: [PHP] First record not diplaying

2008-12-22 Thread Gary Maddock-Greene
so the correct way to do this is remove the $row_rsSearch = mysql_fetch_assoc($rsSearch); from my recordset query code. Thank you SanTa -- - Gary Maddock-Greene ""Sándor Tamás (HostWare Kft . )"" wrote in message news:dbb55d182b624f26be7f5125e592d...@stgepe... Yes, the error is here. You get

Re: [PHP] eof bof in php

2008-12-22 Thread Anthony Gentile
I would argue it is better practice as: than Hello World"; ?> Anthony Gentile On Mon, Dec 22, 2008 at 9:18 AM, tedd wrote: > At 1:21 PM -0500 12/21/08, Anthony Gentile wrote: > >> -snip exampe- >> >> >> is probably going to give you the result you want. However you should know >> it is bad

Re: [PHP] eof bof in php

2008-12-22 Thread Ashley Sheridan
On Mon, 2008-12-22 at 14:21 -0500, Anthony Gentile wrote: > I would argue it is better practice as: > > > > than > > echo "Hello World"; > ?> > Anthony Gentile > > > On Mon, Dec 22, 2008 at 9:18 AM, tedd wrote: > > > At 1:21 PM -0500 12/21/08, Anthony Gentile wrote: > > > >> -snip exampe-

Re: [PHP] eof bof in php

2008-12-22 Thread Anthony Gentile
Well you said it...for my example it makes sense. For when it gets really messy by all means concatenate with php. However, my argument is not so much keeping html seperate from php as it is keeping the business logic separate from the presentationso if you have php writing html and its all dea

Re: [PHP] eof bof in php

2008-12-22 Thread Ashley Sheridan
On Mon, 2008-12-22 at 15:04 -0500, Anthony Gentile wrote: > Well you said it...for my example it makes sense. For when it gets really > messy by all means concatenate with php. However, my argument is not so much > keeping html seperate from php as it is keeping the business logic separate > from t

[PHP] get_browser() too slow

2008-12-22 Thread Martin Zvarík
Hello, anyone has a good function for getting a user's browser, OS and crawler detection ? I have looked at google etc, but I ran only into long list of ineffective ereg()s functions or not checking if it's crawler... Is it possible to make an array list and just check using strpos() each on

[PHP] Re: get_browser() too slow

2008-12-22 Thread Martin Zvarík
Martin Zvarík napsal(a): Hello, anyone has a good function for getting a user's browser, OS and crawler detection ? I have looked at google etc, but I ran only into long list of ineffective ereg()s functions or not checking if it's crawler... Is it possible to make an array list and just ch

[PHP] Regular expressions (regex) question for parsing

2008-12-22 Thread Rene Fournier
Hi, I'm looking for some ideas on the best way to parse blocks of text that is formatted such as: $sometext %\r\n -- good data $otherstring %\r\n -- good data $andyetmoretext %\r\n

Re: [PHP] Re: get_browser() too slow

2008-12-22 Thread Nathan Nobbe
2008/12/22 Martin Zvarík > Martin Zvarík napsal(a): > >> Hello, >> anyone has a good function for getting a user's browser, OS and crawler >> detection ? >> >> I have looked at google etc, but I ran only into long list of ineffective >> ereg()s functions or not checking if it's crawler... >> >> I

Re: [PHP] Regular expressions (regex) question for parsing

2008-12-22 Thread Daniel Brown
On Mon, Dec 22, 2008 at 15:56, Rene Fournier wrote: > > Each line should start with a $dollar sign, then some arbitrary text, ends > with a percent sign, followed by carriage-return and line-feed. Sometimes > though, the final line is not complete. In that case, I want to save those > lines too.

[PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Clancy
On Mon, 22 Dec 2008 10:20:09 +1100, dmag...@gmail.com (Chris) wrote: >I'd call this a micro-optimization. If changing this causes that much of >a difference in your script, wow - you're way ahead of the rest of us. Schlossnagle (in "Advanced PHP Programming") advises: $i = 0; while

Re: [PHP] eof bof in php

2008-12-22 Thread Kyle Terry
On Dec 22, 2008, at 12:15 PM, Ashley Sheridan wrote: On Mon, 2008-12-22 at 15:04 -0500, Anthony Gentile wrote: Well you said it...for my example it makes sense. For when it gets really messy by all means concatenate with php. However, my argument is not so much keeping html seperate from

Re: [PHP] Regular expressions (regex) question for parsing

2008-12-22 Thread Jim Lucas
Rene Fournier wrote: > Hi, I'm looking for some ideas on the best way to parse blocks of text > that is formatted such as: > > $sometext %\r\n-- good data > $otherstring %\r\n-- good data > $andyetmoretext %\r\n-- good data

[PHP] EPP server - TLS conection

2008-12-22 Thread Evandro Sestrem
Hello, I'm trying to connect in a EPP server (TLS), but I'm getting the message: Warning: stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure in testepp.php on l

[PHP] unsubscring from the list

2008-12-22 Thread Sudhakar
hi i would like to unsubscribe from this php list as i keep getting too many emails. how do i unsubscribe. also later on if i would like to ask a question about php if i unsubscribe will i be able to send a message and only receive replies to my question. please advice. thanks.

Re: [PHP] unsubscring from the list

2008-12-22 Thread Chris
Sudhakar wrote: hi i would like to unsubscribe from this php list as i keep getting too many emails. how do i unsubscribe. http://php.net/unsub.php -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP] unsubscring from the list

2008-12-22 Thread Michael S. Dunsavage
On Tue, 2008-12-23 at 10:33 +1100, Chris wrote: > Sudhakar wrote: > > hi > > > > i would like to unsubscribe from this php list as i keep getting too many > > emails. how do i unsubscribe. > > http://php.net/unsub.php > Maybe change your subscription to digest form? -- Michael S. Dunsavage --

Re: [PHP] unsubscring from the list

2008-12-22 Thread Ashley Sheridan
On Tue, 2008-12-23 at 04:51 +0530, Sudhakar wrote: > hi > > i would like to unsubscribe from this php list as i keep getting too many > emails. how do i unsubscribe. > > also later on if i would like to ask a question about php if i unsubscribe > will i be able to send a message and only receive

[PHP] Re: Regular expressions (regex) question for parsing

2008-12-22 Thread Al
Rene Fournier wrote: Hi, I'm looking for some ideas on the best way to parse blocks of text that is formatted such as: $sometext %\r\n-- good data $otherstring %\r\n-- good data $andyetmoretext %\r\n-- good data $fina

[PHP] shell_exec seems to hang other web requests while running convert

2008-12-22 Thread German Geek
Hi All, The following problem: Our client is converting pdfs to images with a web interface. At the moment I'm using convert from imagemagick with shell_exec (i know i could use the imagick module, but this would require quite a bit of recoding and time at the moment, it was originally running on

Re: [PHP] shell_exec seems to hang other web requests while running convert

2008-12-22 Thread Nathan Nobbe
On Mon, Dec 22, 2008 at 9:06 PM, German Geek wrote: > Hi All, > > The following problem: > > Our client is converting pdfs to images with a web interface. At the moment > I'm using convert from imagemagick with shell_exec (i know i could use the > imagick module, but this would require quite a bi

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Nathan Nobbe
On Mon, Dec 22, 2008 at 3:10 PM, Clancy wrote: > On Mon, 22 Dec 2008 10:20:09 +1100, dmag...@gmail.com (Chris) wrote: > > >I'd call this a micro-optimization. If changing this causes that much of > >a difference in your script, wow - you're way ahead of the rest of us. > > Schlossnag

Re: [PHP] shell_exec seems to hang other web requests while running convert

2008-12-22 Thread German Geek
cron is a good idea, havent thought about that. One could use the nice program then to give it the lowest priority, because other requests are more important than this and another server gives the issue of transfering files back and forth. Another soln would be to run it with & in the background (w

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread German Geek
agree, ++$i wont save u nething, it just means that the variable is incremented after it is used: $i = 0; while ($i < 4) echo $i++; will output 0123 while $i = 0; while ($i < 4) echo ++$i; will output 1234 Tim-Hinnerk Heuer http://www.ihostnz.com On Tue, Dec 23, 2008 at 7:25 PM, Nathan Nob

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Lars Torben Wilson
2008/12/22 Nathan Nobbe : > On Mon, Dec 22, 2008 at 3:10 PM, Clancy wrote: > >> On Mon, 22 Dec 2008 10:20:09 +1100, dmag...@gmail.com (Chris) wrote: >> >> >I'd call this a micro-optimization. If changing this causes that much of >> >a difference in your script, wow - you're way ahead

Re: [PHP] shell_exec seems to hang other web requests while running convert

2008-12-22 Thread Nathan Nobbe
On Mon, Dec 22, 2008 at 11:34 PM, German Geek wrote: > cron is a good idea, havent thought about that. One could use the nice > program then to give it the lowest priority, because other requests are more > important than this and another server gives the issue of transfering files > back and for

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Lars Torben Wilson
2008/12/22 German Geek : > agree, ++$i wont save u nething, it just means that the variable is > incremented after it is used: You meant ". . .before it is used:", right? Torben > $i = 0; > while ($i < 4) echo $i++; > > will output > 0123 > > while > > $i = 0; > while ($i < 4) echo ++$i; > > wi

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Nathan Nobbe
On Mon, Dec 22, 2008 at 11:43 PM, Lars Torben Wilson wrote: > 2008/12/22 German Geek : > > agree, ++$i wont save u nething, it just means that the variable is > > incremented after it is used: > > You meant ". . .before it is used:", right? i hope so, coming from an individual who likes to optim

Re: [PHP] Regular expressions (regex) question for parsing

2008-12-22 Thread Lars Torben Wilson
2008/12/22 Jim Lucas : > Rene Fournier wrote: >> Hi, I'm looking for some ideas on the best way to parse blocks of text >> that is formatted such as: >> >> $sometext %\r\n-- good data >> $otherstring %\r\n-- good data >> $andyetmoretext %\r\n