Re: [PHP] Question about the mail() php function

2004-04-23 Thread Richard Harb
If I had to take a wild guess I'd say that there's no mail server on your machine that would be capable of accepting email for delivery. And that Warning is PHP's effort to tell you just that. Hint: google - and I bet most other search engines - give you plenty of sites providing good information

Re: [PHP] Question about the mail() php function

2004-04-23 Thread Travis Low
Sounds like you don't have a mail server running on localhost at port 25. If you do have a mail server running, then it seems to me that you should verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Abyss Web Server\htdocs\page.php on line 24. Just parap

[PHP] Question about the mail() php function

2004-04-23 Thread Shawn Inder
Hello, I was browsing your site and came across the mail() PHP function. I tryed it out: [EMAIL PROTECTED] is my e-mail adress, obviously enough.. The problem is, the e-mail doesn't get sent. A warning appears on the page: Warning: mail(): Failed to connect to mailserver at "localhost" port 25,

Re: [PHP] overloaded, overworked ereg statement?

2004-04-23 Thread Travis Low
Break it up a little. Try something like this: $title = preg_replace( "/.*/i", "", $file_text ); $title = preg_replace( "/.*/i", "", $title ); Ditto for body. Since you're looking for certain tags, it stands to reason that you're primarily interested in characters after "<" characters. So this

RE: [PHP] overloaded, overworked ereg statement?

2004-04-23 Thread electroteque
Isnt ereg meant to be slower than preg anyway ? > -Original Message- > From: Tim [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 24, 2004 2:02 PM > To: [EMAIL PROTECTED] > Subject: [PHP] overloaded, overworked ereg statement? > > > This script worked on one server, but started choking

[PHP] overloaded, overworked ereg statement?

2004-04-23 Thread Tim
This script worked on one server, but started choking after I moved it to a new server. Summary: I use the php_auto_prepend script to start output buffering, then use the php_auto_append script to extract the content between the title tags and between the body tags. When the size of the conte

[PHP] static __get function

2004-04-23 Thread David Goodlad
Hi all... I'm trying to build a simple configureation class (using the singleton pattern). Using PHP5, I want to use the __get and __set methods to access configuration settings for my site. However, they don't work :P Here's my class definition: class Configuration { static private

Re: [PHP] The COM problem when converting from ASP to PHP

2004-04-23 Thread Richard Davey
Hello Steven, Saturday, April 24, 2004, 2:08:20 AM, you wrote: SK> Hi, SK> When I converting lines of ASP code: SK> <% SK> dim keysobjs SK> dim privkey SK> dim pubkey SK> dim seed SK> Set keysobj= CreateObject("wmrmobjs.WMRMKeys") SK> keysobj.GenerateSigningKeys privkey, pubkey SK> seed = keyso

[PHP] The COM problem when converting from ASP to PHP

2004-04-23 Thread Steven Kidd
Hi, When I converting lines of ASP code: <% dim keysobjs dim privkey dim pubkey dim seed Set keysobj= CreateObject("wmrmobjs.WMRMKeys") keysobj.GenerateSigningKeys privkey, pubkey seed = keysobj.GenerateSeed() Response.Write privkey Response.Write "" Response.Write pubkey Response.Write "" Respon

Re: [PHP] bad interpreter: No such file or directory

2004-04-23 Thread Curt Zirzow
* Thus wrote CSN ([EMAIL PROTECTED]): > I have PHP scripts that start off as so: > > #!/usr/local/bin/php > // php code ... > ?> > > They're chmod a+x. "which php" returns > "/usr/local/bin/php". Used to work just fine using > "./script.php". Now, that gives this error: "bad > interpreter: No su

Re: [PHP] bad interpreter: No such file or directory

2004-04-23 Thread CSN
[EMAIL PROTECTED] That was it (fixed with dos2unix). Thanks --- "Roger B.A. Klorese" <[EMAIL PROTECTED]> wrote: > CSN wrote: > > >Anybody know what the problem is? > > > > > > > Are you sure the files have not been edited with a > Windows editor and > therefore have CR-LF line endings? I

Re: [PHP] oblivious to the obvious

2004-04-23 Thread Chris Shiflett
--- Arthur Pelkey <[EMAIL PROTECTED]> wrote: > I keep getting Warning: mysql_fetch_array(): supplied argument is not > a valid MySQL result resource in lines 17 and 21 [snip] > $result = mysql_query("...") If mysql_query() returns false (which you can test by checking the value of $result, for e

[PHP] bad interpreter: No such file or directory

2004-04-23 Thread CSN
I have PHP scripts that start off as so: #!/usr/local/bin/php They're chmod a+x. "which php" returns "/usr/local/bin/php". Used to work just fine using "./script.php". Now, that gives this error: "bad interpreter: No such file or directory". However, "php script.php" still executes the script fi

[PHP] Socket server with multiple connections

2004-04-23 Thread René Fournier
I've gone through a few good socket client and server tutorials (such as http://www.devshed.com/c/a/PHP/Socket-Programming-With-PHP/), and have got the samples working. What I'm trying to do now is write a simple Socket Server that will accept multiple connections, do its thing, and keep runnin

Re: [PHP] Fetching XML for parsing

2004-04-23 Thread Mike Ryerse
How is your fopen code written? Could it have something to do with your browser is requesting a dynamically built page, and your php script is not? --- Patagonia Hosting Development Group <[EMAIL PROTECTED]> wrote: > Hi all, > > I know that fopen and fread should do the trick, but for some > stra

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Chris Shiflett
--- Gabe <[EMAIL PROTECTED]> wrote: > Here's what I tried and it seems to be working now. Thanks Richard! > > $var = date("m-d-Y", strtotime($dbDate)); > > $var then has the value of the date only. Still curious as to why > those extra zero's are tacked on. It's because MySQL is storing the date

[PHP] Fetching XML for parsing

2004-04-23 Thread Patagonia Hosting Development Group
Hi all, I know that fopen and fread should do the trick, but for some strange reason (maybe piping) I get an error when trying to fetch a XML document generated from an ASP page. If I open the file in my browser, I click in "View Source Code", copy and paste it in a new notepad document, save it a

[PHP] Fetching XML for parsing

2004-04-23 Thread Patagonia Hosting Development Group
Hi all, I know that fopen and fread should do the trick, but for some strange reason (maybe piping) I get an error when trying to fetch a XML document generated from an ASP page. If I open the file in my browser, I click in "View Source Code", copy and paste it in a new notepad document, save it a

[PHP] PHP5 RC1 rpms for Mandrake 10

2004-04-23 Thread Andrei Verovski (aka MacGuru)
Hi, Anyone can suggest me where I can get PHP5 RC1 rpms (with possible max# of extensions) for Mandrake 10? I have tried to make them myself, but run into numerous problems. Thanks in advance for any suggestion(s) Andrei Verovski (aka MacGuru) -- PHP General Mailing List (http://www.php.net/

Re: [PHP] MySQL Dump

2004-04-23 Thread Michal Migurski
> Will this work on both a Windows and Unix server? No, it's most assuredly a unix-only thing. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http:

Re: [PHP] Scripting practices

2004-04-23 Thread Travis Low
Also, for the lazy variable typing. To me, strong typing means pounding the keyboard extra hard. cheers, Travis Travis Low wrote: It's not necessary. If you want to go to that much trouble, I would switch to Java for the speed. I stick with PHP for the shorter development time. cheers, T

Re: [PHP] Scripting practices

2004-04-23 Thread Travis Low
It's not necessary. If you want to go to that much trouble, I would switch to Java for the speed. I stick with PHP for the shorter development time. cheers, Travis Gabe wrote: When scripting in a language (such as PHP) that doesn't require you to determine the variable type before you use it

RE: [PHP] Scripting practices

2004-04-23 Thread Chris W. Parker
Gabe on Friday, April 23, 2004 1:55 PM said: > When scripting in a language (such as PHP) that doesn't require you to > determine the variable type before you use it, is it still considered > good technique to initialize it to the type you're going to use it as? > Or

Re: [PHP] Scripting practices

2004-04-23 Thread Robert Cummings
On Fri, 2004-04-23 at 16:55, Gabe wrote: > When scripting in a language (such as PHP) that doesn't require you to > determine the variable type before you use it, is it still considered > good technique to initialize it to the type you're going to use it as? > Or is it considered ok to just use

Re: [PHP] Scripting practices

2004-04-23 Thread Mattias Thorslund
I use precisely what you suggest. If you later find out you'd like to wrap a few lines inside a loop, this avoids a potential bug when a variable is not reset to the initial value for each iteration. On Fri, 2004-04-23 at 13:55, Gabe wrote: > When scripting in a language (such as PHP) that doesn

[PHP] Scripting practices

2004-04-23 Thread Gabe
When scripting in a language (such as PHP) that doesn't require you to determine the variable type before you use it, is it still considered good technique to initialize it to the type you're going to use it as? Or is it considered ok to just use it? e.g. $strText = "";//initialize $st

[PHP] Re: Reristration form

2004-04-23 Thread Erik Gjertsen
Thanks it helps Erik Gjertsen "Erik Gjertsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I shall made a registration schema to user log on. But when I fill in > everything I still com up messages that you must go back and try again. > Or can someone help me to find a script I can

Re: [PHP] MySQL Dump

2004-04-23 Thread Matt Palermo
Will this work on both a Windows and Unix server? "Michal Migurski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Is there an easy way to do a mysql dump routine written in php? I > > basically want to write a function to backup a database and have it > > create all the neccess

Re: [PHP] oblivious to the obvious

2004-04-23 Thread John Nichel
Arthur Pelkey wrote: I keep getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in lines 17 and 21, they are marked below. I am drawing a blank, starting to doze off also :S, thunderbird has crappy default composition widths(anyone know how to change it?)

Re: [PHP] oblivious to the obvious

2004-04-23 Thread Matt Matijevich
[snip] $sun_5a_n1 = "1"; $sun_5a_t1 = "2"; if($sun_5a_n1) { $result = mysql_query("UPDATE sunday SET a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1'") while($row = mysql_fetch_array($result)) { (line 17)echo "Sunday @ 5am slot modified to Name: $sun_5a_n1, Time: $sun_5a_t

[PHP] oblivious to the obvious

2004-04-23 Thread Arthur Pelkey
I keep getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in lines 17 and 21, they are marked below. I am drawing a blank, starting to doze off also :S, thunderbird has crappy default composition widths(anyone know how to change it?), so the formatting

[PHP] Re: Creating an assoc array from two arrays

2004-04-23 Thread Gabe
Alex Hogan wrote: Hi All, I am looking through the manual and I think I may be blind or something, but how can I create an associative array from two arrays. What I have is two arrays that look like this; Array1([0]=>Spider, [1]=>Monkey, [2]=>Cards) Array2([0]=>26.3, [1]=>0.65, [2]=>62.07) I want

[PHP] Re: PHP Mag (Was: Counting number of characters without spaces between them?)

2004-04-23 Thread Richard Davey
Hello Chris, Friday, April 23, 2004, 8:28:51 PM, you wrote: CS> Thanks. :-) I haven't seen it yet. Is this in the print or PDF edition? Print. My copy arrived today (with my cover story.. yay!) and a nice Beginners piece from Amy as well. -- Best regards, Richard Davey http://www.phpcommunit

Re: [PHP] Vulnerabilities in vBulletin ????

2004-04-23 Thread Richard Davey
Hello Phpu, Friday, April 23, 2004, 8:26:12 PM, you wrote: P> I have vBulletin installed on my site. A few hours ago a P> friend sent me a link to securityfocus.com. P> There, it is said that if i have vBulletin installed i could be vulnerable. P> Here the script shown on the site [snip]

[PHP] PHP Mag (Was: Counting number of characters without spaces between them?)

2004-04-23 Thread Chris Shiflett
--- Richard Davey <[EMAIL PROTECTED]> wrote: > BTW - Nice piece in Int PHP Mag this month :) Thanks. :-) I haven't seen it yet. Is this in the print or PDF edition? Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams

[PHP] Vulnerabilities in vBulletin ????

2004-04-23 Thread Phpu
I have vBulletin installed on my site. A few hours ago a friend sent me a link to securityfocus.com. There, it is said that if i have vBulletin installed i could be vulnerable. Here the script shown on the site [form action="http://[victim]/register.php?do=register"; method="post" style="d

Re: [PHP] Creating an assoc array from two arrays

2004-04-23 Thread John W. Holmes
From: "Alex Hogan" <[EMAIL PROTECTED]> > I am looking through the manual and I think I may be blind or something, but > how can I create an associative array from two arrays. > What I have is two arrays that look like this; > > Array1([0]=>Spider, [1]=>Monkey, [2]=>Cards) > Array2([0]=>26.3, [1]=>0

[PHP] Creating an assoc array from two arrays

2004-04-23 Thread Alex Hogan
Hi All, I am looking through the manual and I think I may be blind or something, but how can I create an associative array from two arrays. What I have is two arrays that look like this; Array1([0]=>Spider, [1]=>Monkey, [2]=>Cards) Array2([0]=>26.3, [1]=>0.65, [2]=>62.07) I want to combine them

Re[2]: [PHP] PHP modifying data from DB?

2004-04-23 Thread Richard Davey
Hello Gabe, Friday, April 23, 2004, 7:48:31 PM, you wrote: G> $var then has the value of the date only. Still curious as to why those G> extra zero's are tacked on. Dare I mention it on this newsgroup, but G> when I used ASP I only got the date without the extra zero's. PHP itself won't add th

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Gabe
Here's what I tried and it seems to be working now. Thanks Richard! $var = date("m-d-Y", strtotime($dbDate)); $var then has the value of the date only. Still curious as to why those extra zero's are tacked on. Dare I mention it on this newsgroup, but when I used ASP I only got the date witho

Re[2]: [PHP] PHP modifying data from DB?

2004-04-23 Thread Richard Davey
Hello Gabe, Friday, April 23, 2004, 7:33:53 PM, you wrote: G> Let's say that getting those zero's is ok. Is this the code that I G> would write to form the proper date I want? G> $dbDate = value from the date field in the database G> date("m-d-Y", $dbDate); Yeah that should be fine - you coul

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Richard Harb
Have a look at strtotime() in addition to date() Richard Friday, April 23, 2004, 8:20:14 PM, thus was written: > I have a field in a DB that contains a date. The format of the date is: > 04/08/2004 > However, when I retrieve the date from DB using PHP, it displays the > following: > 2004-04-0

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Gabe
Hi Richard, I checked the field type in access and it is a date/time field (it's the only option). However, in access I told it to do a short date format mm/dd/. Unfortunately it still gives me those extra zero's. Let's say that getting those zero's is ok. Is this the code that I would

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Richard Davey
Hello Gabe, Friday, April 23, 2004, 7:20:14 PM, you wrote: G> However, when I retrieve the date from DB using PHP, it displays the G> following: G> 2004-04-08 00:00:00 G> Is PHP tacking on the zero's? I've tried using the date() function to G> reformat it back to how I want it, but haven't got

[PHP] Re: PHP modifying data from DB?

2004-04-23 Thread Gabe
I should also probably mention that I'm using ADOdb as well. Gabe wrote: I have a field in a DB that contains a date. The format of the date is: 04/08/2004 However, when I retrieve the date from DB using PHP, it displays the following: 2004-04-08 00:00:00 Is PHP tacking on the zero's? I've

[PHP] PHP modifying data from DB?

2004-04-23 Thread Gabe
I have a field in a DB that contains a date. The format of the date is: 04/08/2004 However, when I retrieve the date from DB using PHP, it displays the following: 2004-04-08 00:00:00 Is PHP tacking on the zero's? I've tried using the date() function to reformat it back to how I want it, but

RE: [PHP] Call to external function

2004-04-23 Thread Jeff McKeon
> > OnLoad is probably occuring after your you're 'stop' call. > Onload generally will be called when the document gets fully > loaded. Instead put the 'go' call in the of your document. > > > > function('go'); > > ... > > > function('stop') > > > > Weird that works when the site is

RE: [PHP] Call to external function

2004-04-23 Thread Mark
--- Jeff McKeon <[EMAIL PROTECTED]> wrote: > > > > No... PHP and JavaScript are executing at different time and > > at different place. Besides, they are executed by different > programs. > > > > Are you trying to measure execution time of a query?? > > > > Look at: > > http://www.php.net/mic

Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote: On Apr 23, 2004, at 10:13 AM, John Nichel wrote: Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%')

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' Because you are using a single quotes around your table/field names. Remove them or use ` (back tick). As sugges

Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]> > My error. Here is the actual return: > > You have an error in your SQL syntax. Check the manual that corresponds > to your MySQL server version for the right syntax to use near > ''my_table' WHERE ('field_1' LIKE '%custom%' OR 'field_ > > I am searching f

RE: [PHP] Call to external function

2004-04-23 Thread Jeff McKeon
> > No... PHP and JavaScript are executing at different time and > at different place. Besides, they are executed by different programs. > > Are you trying to measure execution time of a query?? > > Look at: > http://www.php.net/microtime No, I'm trying to get a little animation on the left f

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' Because you are using a single quotes around your table/field names. Remove them or use ` (back tick). As sugges

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Richard Davey
Hello Brian, Friday, April 23, 2004, 6:18:43 PM, you wrote: BD> You have an error in your SQL syntax. Check the manual that corresponds BD> to your MySQL server version for the right syntax to use near BD> ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' my_table should NOT be quoted in this

Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]): > > On Apr 23, 2004, at 10:13 AM, John Nichel wrote: > > >Brian Dunning wrote: > >>I STFW and RTFM and I still can't figure out why this returns a 1064 > >>parse error: > >>SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > >>'field_

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:27 AM, Edward Peloke wrote: doesn't look like your $keyword value contains anything. My error. Here is the actual return: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHER

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
doesn't look like your $keyword value contains anything. -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 1:19 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... On Apr 23, 2004, at 10:13 AM, John Nichel wrote: > Brian Dunning wro

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:13 AM, John Nichel wrote: Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'acti

Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; Anyone? TIA! - B1ff Lamer What does mysql_

RE: [PHP] Reristration form

2004-04-23 Thread Edward Peloke
you are looking for $username but your id is $usermame. -Original Message- From: Erik Gjertsen [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 1:01 PM To: [EMAIL PROTECTED] Subject: [PHP] Reristration form I shall made a registration schema to user log on. But when I fill in every

Re: [PHP] Reristration form

2004-04-23 Thread Richard Davey
Hello Erik, Friday, April 23, 2004, 6:00:42 PM, you wrote: EG> 1..if ($name && $email && $username && $password) Look carefully at the spelling of $username above and here: EG> if (strlen($_POST["usermame"]) > 0) { EG> $usermame = TRUE; EG> } else { EG> $usermame = FALSE; EG> } $

[PHP] Reristration form

2004-04-23 Thread Erik Gjertsen
I shall made a registration schema to user log on. But when I fill in everything I still com up messages that you must go back and try again. Or can someone help me to find a script I can use?? I have set 1 Where I think it is problem. The following code is Enter your information in the for

Re[2]: [PHP] Counting number of characters without spaces between them?

2004-04-23 Thread Richard Davey
Hello Chris, Friday, April 23, 2004, 5:41:59 PM, you wrote: CS> You can explode on a space and loop through the resulting array, checking CS> strlen() as you go. In the end I used a regexp to strip out all non alpha-numeric characters from the string - and then compared the length of this to wha

Re: [PHP] Call to external function

2004-04-23 Thread Curt Zirzow
* Thus wrote Torsten Roehr ([EMAIL PROTECTED]): > > I have the script start when the page loads with an > onload=function('go') in the tag. > > But I need someway to turn it off... A simple: > > Echo "function('stop')"; at the end of the page OnLoad is probably occuring after your you're 'stop

Re: [PHP] Counting number of characters without spaces between them?

2004-04-23 Thread Chris Shiflett
--- Richard Davey <[EMAIL PROTECTED]> wrote: > I want to be able to check to see if, in a string, the user has > entered too many consecutive characters and not enough spaces. For > example they might enter a subject like: > > "hello world! how arrre you today?!!" >

Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]): > I STFW and RTFM and I still can't figure out why this returns a 1064 > parse error: > > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; You

Re: [PHP] Call to external function

2004-04-23 Thread William Lovaton
No... PHP and JavaScript are executing at different time and at different place. Besides, they are executed by different programs. Are you trying to measure execution time of a query?? Look at: http://www.php.net/microtime -William El vie, 23-04-2004 a las 09:09, Jeff McKeon escribió: > Is t

Re: [PHP] OK SQL experts...

2004-04-23 Thread William Lovaton
How are you manipulating the whole SQL string?? $sql = "SELECT..."; ??? or $sql = 'SELECT...'; ??? In this case you will have to use double quotes because PHP won't parse single quote strings for searching embedded PHP variables. May be this is the problem. -William El vie, 23-04-2004 a

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Richard Davey
Hello Brian, Friday, April 23, 2004, 5:02:00 PM, you wrote: BD> Yes, I actually did exactly that. Everything works until I have more BD> than one statement inside the (x LIKE x OR x LIKE x) parens. That's why BD> I figured there has to be something wrong with my paren structure. When BD> I RTFM I

Re[4]: [PHP] OK SQL experts...

2004-04-23 Thread Tom Rogers
Hi, Saturday, April 24, 2004, 2:03:36 AM, you wrote: JB> [snip] JB> They do if they are themselves inside double quotes :) JB> echo "'$var'"; will get parsed ok JB> [/snip] JB> I know, but since I saw no double quotes I had to go for the obvious. :) Yes I would like to see the "whole truth" as

RE: Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] They do if they are themselves inside double quotes :) echo "'$var'"; will get parsed ok [/snip] I know, but since I saw no double quotes I had to go for the obvious. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
if that works move up into: SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status = 'active'; Yes, I actually did exactly that. Everything works until I have more than one statement inside the (x LIKE x OR x LIKE x) parens. That's why I figured there has to be something wrong with m

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Tom Rogers
Hi, Saturday, April 24, 2004, 1:55:36 AM, you wrote: JB> [snip] JB> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR JB> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND JB> 'status' = 'active'; JB> [/snip] JB> *slaps forehead* JB> "SELECT * FROM my_table WHERE (fi

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status = 'active'; if that works continue until you get an error. [/snip] That'll give you an error right there. That old single quoted variable will get you every time. :) WHERE (field_1 LIKE '%$keyword%') WHERE (field_1 LIKE

RE: [PHP] OK SQL experts...

2004-04-23 Thread Chris W. Parker
Brian Dunning on Friday, April 23, 2004 8:19 AM said: > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; have you tried simply: SELECT * FROM my_table WHERE statu

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I don't have access to the MySQL command line; it's hosted at my ISP. :( On Apr 23, 2004, at 8:54 AM, Mark wrote: --- Brian Dunning <[EMAIL PROTECTED]> wrote: Yes, I've checked and rechecked the spelling on everything. I've been testing with a word that I know appears in at least one of the fiel

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; [/snip] *slaps forehead* "SELECT * FROM my_table WHERE (field_1 LIKE '%" . $keyword . "%' OR field_2 LIKE '%" . $keyword . "%' OR field_3 L

RE: [PHP] OK SQL experts...

2004-04-23 Thread Daniel Purdy
>>> I STFW and RTFM and I still can't figure out why this returns a 1064 >>> parse error: >>> >>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR >>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND >>> 'status' = 'active'; Why don't you try rebuilding the query. I

Re: [PHP] OK SQL experts...

2004-04-23 Thread Mark
--- Brian Dunning <[EMAIL PROTECTED]> wrote: > Yes, I've checked and rechecked the spelling on everything. I've > been > testing with a word that I know appears in at least one of the > fields. > I'm coming in a bit late, but have you tried echoing out the query variable contents and copying an

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
phpmyadmin echoes it out exactly as I copied & pasted into my first post. On Apr 23, 2004, at 8:56 AM, Edward Peloke wrote: if you echo out the query..what is the output? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PR

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
Yes, I've checked and rechecked the spelling on everything. I've been testing with a word that I know appears in at least one of the fields. On Apr 23, 2004, at 8:54 AM, Edward Peloke wrote: what value is being put in the $keyword variable? You are sure all these columns exist? -Original

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
if you echo out the query..what is the output? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no difference. I believe the

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
what value is being put in the $keyword variable? You are sure all these columns exist? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; [/snip] How about this? SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%')

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jeff McKeon
> >> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > >> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > >> 'status' = 'active'; Longshot but try to remove the ' ' from around the field names in the where statement.. Or SELECT * FROM My_Table WHERE field_1 li

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
Backticks, single quotes, or nothing at all makes no difference. I believe the parsing error is due to my parentheses or AND/OR structure. Any thoughts on that? On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote: From: "Brian Dunning" <[EMAIL PROTECTED]> I STFW and RTFM and I still can't figu

Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]> > I STFW and RTFM and I still can't figure out why this returns a 1064 > parse error: > > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; Use backt

Re: [PHP] OK SQL experts...

2004-04-23 Thread Richard Harb
AFAIK phpMyAdmin uses backticks for table/field names, not single quotes ... Friday, April 23, 2004, 5:22:35 PM, thus was written: > I tried it both ways - didn't make any difference (phpmyadmin adds the > single quotes when I was trying to use its sql function to debug, so I > figured what the h

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
It gives the same error when I run it in phpmyadmin. On Apr 23, 2004, at 8:34 AM, Edward Peloke wrote: does it just return the error when running in the php page? If you pull it out can you run it in mysql without errors? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED]

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
does it just return the error when running in the php page? If you pull it out can you run it in mysql without errors? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... I trie

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] I tried it both ways - didn't make any difference (phpmyadmin adds the single quotes when I was trying to use its sql function to debug, so I figured what the hell)... [/snip] Those aren't single quotes it adds to table and column names...those are back tics (on the same key as the tilde)

Re: [PHP] Re: How to do type/existence checking in PHP5

2004-04-23 Thread Curt Zirzow
* Thus wrote Christian Jul Jensen ([EMAIL PROTECTED]): > > Hi > > Thanks for taking time to look into this. > > [EMAIL PROTECTED] (Red Wingate) writes: > > > > this is a plain design fault on your side: > > I'm sorry, but I don't agree. It is standard in PHP4, and one of the > advantages of

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I tried it both ways - didn't make any difference (phpmyadmin adds the single quotes when I was trying to use its sql function to debug, so I figured what the hell)... On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote: why are the table and field names surrounded by single quotes? -Original

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
why are the table and field names surrounded by single quotes? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:19 AM To: [EMAIL PROTECTED] Subject: [PHP] OK SQL experts... I STFW and RTFM and I still can't figure out why this returns a 106

[PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; Anyone? TIA! - B1ff Lamer -- PHP General Mailing List (http://

Re[2]: [PHP] Counting number of characters without spaces between them?

2004-04-23 Thread Richard Davey
Hello Tom, Friday, April 23, 2004, 3:42:57 PM, you wrote: TR> $string = "hello world! how arrre you today?!!"; TR> if(preg_match_all('/(\w)\1{4,}|(\W)\2{4,}/',$string,$match)){ TR> echo "too many repeated characters"; TR> print_r($match); TR> } TR> That will ca

Re[2]: [PHP] Counting number of characters without spaces between them?

2004-04-23 Thread Tom Rogers
Hi, Saturday, April 24, 2004, 12:42:57 AM, you wrote: TR> Hi, TR> Friday, April 23, 2004, 11:50:56 PM, you wrote: TR> You could try something like this TR> $string = "hello world! how arrre you today?!!"; TR> if(preg_match_all('/(\w)\1{4,}|(\W)\2{4,}/',$string,$m

Re: [PHP] reg exp for smtp error codes

2004-04-23 Thread Curt Zirzow
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]): > hey professionals out there! > > does anybody have a script that parses the error-code from a returned > email-header (esmtp)? You dont need a regex, just a simple explode will work: list($code, $message) = explode(" ", $result_string, 2);

Re: [PHP] Counting number of characters without spaces between them?

2004-04-23 Thread Tom Rogers
Hi, Friday, April 23, 2004, 11:50:56 PM, you wrote: RD> Hi all, RD> It's a warm sunny day and I'm trying to wrap my head around the RD> following: RD> I want to be able to check to see if, in a string, the user has RD> entered too many consecutive characters and not enough spaces. For RD> exampl

Re: [PHP] Call to external function

2004-04-23 Thread Torsten Roehr
This is more of a JavaScript than a PHP question. Maybe you could search google for 'stop JavaScript function' or something. Torsten "Jeff McKeon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > [snip] > Is this possible? > [/snip] > > Anything is possible! > > Have you considered

  1   2   >