Re: [PHP-DB] ip address

2004-09-30 Thread Philip Thompson
balwant, It seems to be working for me. I have looked at it from multiple computers, and it always gives the ip of that computer. Try for yourself: http://housing.uark.edu/resnet/ip.php Let me know if you get something other than your ip. ~Philip balwantsingh wrote: i tried the

Re: [PHP-DB] ip address

2004-09-30 Thread Ramil Sagum
On Thu, 30 Sep 2004 11:00:35 +0530, balwantsingh [EMAIL PROTECTED] wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. what exactly did you do? the

Re: [PHP-DB] Capturing a sql query

2004-09-30 Thread M Saleh EG
I'd recommand u to use a serialized variable saved in ur database. As in the an array of keywords saved in an serialized variable once the form is submited to save the query. e.g. $searchQuery = array(); $searchQuery[Keywords]= $_POST[keyword]; $searchQuery[JobCategory]= $_POST[category];

Re: [PHP-DB] Capturing a sql query

2004-09-30 Thread Stuart Felenstein
Serialized because it is easier to store ? Stuart --- M Saleh EG [EMAIL PROTECTED] wrote: I'd recommand u to use a serialized variable saved in ur database. As in the an array of keywords saved in an serialized variable once the form is submited to save the query. e.g. $searchQuery =

[PHP-DB] searchengine input split

2004-09-30 Thread Murat BIYIKLI
I need to split the keyword on search input and generate an sql query, for ex: the input value is: europe+america,asia so I want to generate an sql like this: SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE %america% OR message LIKE %asia% The + (plus) means AND and ,

[PHP-DB] spliting keywords by GET method and SQL query

2004-09-30 Thread Murat BIYIKLI
I need to split the keyword on search input and generate an sql query, for ex: the input value is: europe+america,asia so I want to generate an sql like this: SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE %america% OR message LIKE %asia% The + (plus) means AND and ,

RE: [PHP-DB] ip address

2004-09-30 Thread Darryl
function getIP() { if (getenv(HTTP_CLIENT_IP) strcasecmp(getenv(HTTP_CLIENT_IP), unknown)) $ip = getenv(HTTP_CLIENT_IP); else if (getenv(HTTP_X_FORWARDED_FOR) strcasecmp(getenv(HTTP_X_FORWARDED_FOR), unknown)) $ip = getenv(HTTP_X_FORWARDED_FOR); else if (getenv(REMOTE_ADDR)

RE: [PHP-DB] searchengine input split

2004-09-30 Thread Bastien Koert
here is something similar. you should be able to adapt this easily ? //Google like search engine for your site, //the $not_search_word array can be added to, //to limit the results even further for those //common words that should not be searched for. foreach ($searchwords as $word) { /* For

Re: [PHP-DB] rand()

2004-09-30 Thread Bastien Koert
The MYI file is the index file. Is there an index on that table? From: [EMAIL PROTECTED] (Jennifer Goodie) To: blackwater dev [EMAIL PROTECTED] CC: [EMAIL PROTECTED], Subject: Re: [PHP-DB] rand() Date: Wed, 29 Sep 2004 23:27:43 + -- Original message from blackwater dev :

Re: [PHP-DB] ip address

2004-09-30 Thread Philip Thompson
Ramil, On Sep 30, 2004, at 1:17 AM, Ramil Sagum wrote: On Thu, 30 Sep 2004 11:00:35 +0530, balwantsingh [EMAIL PROTECTED] wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an

Re: [PHP-DB] spliting keywords by GET method and SQL query

2004-09-30 Thread Brian
$whereStatement=str_replace(+, AND message LIKE , $strToParse); $whereStatement=str_replace(,, OR message LIKE , $whereStatement); SELECT * FROM mytable WHERE message LIKE $whereStatement As for your invalid input example, good luck, I don't see any easy way of doing that. On Wed, 29 Sep

[PHP-DB] Re: searchengine input split

2004-09-30 Thread Murat BIYIKLI
I can't get an efficient solution, the sql query to be generated by input keywords should be boolean. The input value should be splitted boolen like Google, they are with all the words, with the exact phrase, with at least one of the words, without the words.. an example input is :: america,asia

Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-30 Thread Lukas Smith
Lester Caine wrote: Ed Lazor wrote: Has any performance testing been done between ADOdb and PEARdb? Not recently. Personally I am still trying to benchmark engines within ADOdb against the latest Firebird. This is an area where any results would be useful. There are speed comparisons on the

[PHP-DB] String handling

2004-09-30 Thread Darryl
Hay, Is there a way to make a string into an integer? I have a value coming from a textbox and I want to check if the amount in it is 1. Thanks, Darryl

Re: [PHP-DB] String handling

2004-09-30 Thread Joseph Crawford
$string = '10001'; if((int)$string) 1) { echo 'Yep it is'; } -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] 802-558-5247 For a GMail account contact me OFF-LIST -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] String handling

2004-09-30 Thread Hutchins, Richard
If you use the value from a text box in a mathematical equation or comparison, PHP will automatically attempt to handle it as an integer or some other numeric type (e.g., float). So if you did something like: if($_POST[myvar] 1){ ... } PHP would handle $_POST[myvar] as an integer

Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-30 Thread Lester Caine
Lukas Smith wrote: mysql: http://marc.theaimsgroup.com/?l=pear-devm=108239153527834w=2 ibase: http://marc.theaimsgroup.com/?l=pear-devm=108240351804395w=2 there are other interesting points being discussed through out this thread but with a noteably focus on the pear abstraction layers.

RE: [PHP-DB] String handling

2004-09-30 Thread Darryl
Yeah, I thought so seeing as I had done it like that previously, turns out it was something else that was causing the problem :D Thanks anyhow :D -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 5:43 PM To: 'Darryl'; [EMAIL

Re: [PHP-DB] Capturing a sql query

2004-09-30 Thread Stuart Felenstein
Trying to set this up and have a question: Example below , the example for state. The field name is s_LocationState The variable is set to state. $State = ; // check any item is selected if (count($s_LocationState) 0 AND is_array($s_LocationState)) { $State = '.implode(',',

Re: [PHP-DB] Names with apostrophe's

2004-09-30 Thread Craig Hoffman
Thanks everyone. urlencode worked like a charm. On Sep 29, 2004, at 3:53 PM, GH wrote: You need to use the urlencode() function On Wed, 29 Sep 2004 13:23:07 -0500, Craig Hoffman [EMAIL PROTECTED] wrote: Hello, I could use some help here. I have an entry in the MySQL, that use an apostrophe,

[PHP-DB] query parser

2004-09-30 Thread Aditya Ivaturi
We have a content management system and one of its features is what we call a databse browser. What it allows you to do is take a table and display contents in the way it is useful for the relevant audience. One of the new features that was requested was editing the content which will in turn be

[PHP-DB] query parser

2004-09-30 Thread Aditya Ivaturi
We have a content management system and one of its features is what we call a databse browser. What it allows you to do is take a table and display contents in the way it is useful for the relevant audience. One of the new features that was requested was editing the content which will in turn

[PHP-DB] Mysql_fetch_array

2004-09-30 Thread Yemi Obembe
Does anyone have an idea what may probably be the cause of this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/ng/mailsender2.php on line 17 - A passion till tomorrow, www.opeyemi.tk

Re: [PHP-DB] Mysql_fetch_array

2004-09-30 Thread Brian
Yup, we're mind readers, I can figure out your entire script and database structure from the error message. On Thu, 30 Sep 2004 13:30:25 -0700 (PDT), Yemi Obembe [EMAIL PROTECTED] wrote: Does anyone have an idea what may probably be the cause of this error: Warning: mysql_fetch_array():

RE: [PHP-DB] Mysql_fetch_array

2004-09-30 Thread Ryan Jameson \(USA\)
It means that the supplied argument is not a valid MySQL result resource so.. Line 17 of your script mailsender2.php is trying to manipulate a variable that isn't actually a mysql result. In some previous line you should have set the result resource variable equal to something else, on that line

[PHP-DB] Re: spliting keywords by GET method and SQL query

2004-09-30 Thread Frank Flynn
The method doesn't matter, use whatever you like. Did this quick just for the fun, it seems to work. Set $search to whatever you'd like to try or to your GET or POST argument. ,,, eurpoe won't cause a problem but + + + europe will generate some odd SQL (although it will work as expected -

Re: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Ramil Sagum
On Fri, 1 Oct 2004 10:27:45 +1000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, When I use the variable $_SERVER['AUTH_USER'] it comes out as domain\\username when inserted into the MySQL database. So when I try to update the record looking for a match as below it doesn't work because the

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
Thanks Ramil, I knew it had something to do with the \, but I still can't figure out how to get the variable into the database without the extra '\' It is entered into the database via a form using the input below: input name=ident type=hidden value=?php echo $_SERVER[AUTH_USER];? Where would I

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
No, still no idea :) I did read the manual but I can't figure out how to use it in my script. I'll paste the page below: FORM ACTION=?php echo($PHP_SELF); ? METHOD=POST TARGET=_self table border=1 width=80% bgcolor=#0D9BA4 tr td width=29%bAEC Submission Title:/td td width=81%

Re: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Ramil Sagum
On Fri, 1 Oct 2004 11:32:29 +1000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: No, still no idea :) $sql = INSERT INTO aec SET date='$date', title='$title', ident='$ident', id='$id'; mysql_query($sql); I feel good today :) so, $sql = INSERT INTO aec SET date='$date', title='$title', ident='

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
I made the change but the domain\username now appears in my database as: domainusername -Original Message- From: Ramil Sagum [mailto:[EMAIL PROTECTED] Sent: Friday, 1 October 2004 11:40 AM To: Baiocchi, Justin (CSIRO IT, Armidale) Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] The

Re: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Ramil Sagum
On Fri, 1 Oct 2004 11:47:50 +1000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I made the change but the domain\username now appears in my database as: domainusername You probably have the magic quotes enabled. The manual page(

[PHP-DB] Re: microsoft access

2004-09-30 Thread Manuel Lemos
Hello, On 09/30/2004 11:28 PM, Matthew Perry wrote: Does anyone know of a good online source for using php and microsoft access. I don't want to have to use asp. Basically, you need to use ODBC but each database supported by ODBC has its own features that require database specific treatment.

RE: [PHP-DB] microsoft access

2004-09-30 Thread Bastien Koert
Here is a basic connect script. I would stringly recommend against using access, use mysql instead. HTML HEAD /HEAD BODY ?php // Program to test connecting to a Microsoft Access ODBC Data Source $connection = odbc_connect(postcard, , ); print Connected to datasourceBRBR;