[PHP] Re: Search/Replace in entire database?

2009-06-15 Thread Peter Ford
Chris Payne wrote: > Hi everyone, > > I am in the middle of creating an editor where you can search and > replace on an individual column in a single table then I came across > something I need to be able to do but not sure how. > > Is it posible (And if so please how :-) to search an entire data

Re: [PHP] Search/Replace in entire database?

2009-06-15 Thread Caner Bulut
Hi Chris, MySQL introduced full - text indexing and searching capabilities back in version 3.23.23. The implementation is straightforward and easy to use — define a FULLTEXT index and use MATCH / AGAINST in the query. Consider this example: CREATE TABLE SOCIAL_EVENT ( EVENT_ID INTEGER UNSIGNE

Re: [PHP] Re: Search/Replace in entire database?

2009-06-15 Thread Michael Shadle
You can always cheat. Use information_schema or just show databases and show tables and loop through it. Just using information_schema is perfect though i think then you can know or query on column type and save some work. Sent from my iPhone On Jun 15, 2009, at 1:10 AM, Peter Ford wrote:

Re: [PHP] Uniquely identifying an array... as a key to another array

2009-06-15 Thread Stuart
2009/6/15 Eddie Drapkin : > Alright, here's the situation.  I'm wrapping memcached, which takes a list > of several servers, into a quasi-singleton.  In other words, I want only one > instance per set of servers, not per server. > > Assuming I had three memcached servers at localhost, 192.168.1.1 a

Re: [PHP] Search/Replace in entire database?

2009-06-15 Thread tedd
At 9:17 PM -0700 6/14/09, Chris Payne wrote: Hi everyone, I am in the middle of creating an editor where you can search and replace on an individual column in a single table then I came across something I need to be able to do but not sure how. Is it posible (And if so please how :-) to search

Re: [PHP] Periodic Actions in PHP?

2009-06-15 Thread tedd
At 9:22 PM +0330 6/14/09, Parham Doustdar wrote: Actually, your message sparked an idea in my [slow] mind. :) I can put the PHP code in a java script, and tell javascript to call it every fifteen seconds. Best option, I think. :) Any ideas? Thanks! Parham: That's exactly what I've done here:

RE: [PHP] Preventing XSS Attacks

2009-06-15 Thread Bob McConnell
From: Ashley Sheridan > On Wed, 2009-06-10 at 18:28 +0200, Nitsan Bin-Nun wrote: >> mysql_real_escape_string() only sanitise the input. I would personally >> only allow [a-zA-Z0-9-_] in search string but that's just me ;) >> Validate the input in some way, or make extra sanitisation of it >> before

[PHP] how to extract fields from associative array into different variables

2009-06-15 Thread PJ
Is there an easier or simpler way to do this? code: $sql = "SELECT first_name, last_name, book_author.ordinal FROM author, book_author WHERE book_author.bookID = $idIN && book_author.authID = author.id ORDER BY ordinal"; $author = array(); if ( ( $results = mysql_query($sql, $

RE: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread Jay Blanchard
[snip] Is there an easier or simpler way to do this? [/snip] http://us2.php.net/manual/en/function.mysql-fetch-row.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread PJ
Jay Blanchard wrote: > [snip] > Is there an easier or simpler way to do this? > [/snip] > > http://us2.php.net/manual/en/function.mysql-fetch-row.php > In what way would this simplify or ease my pain? The difficulty, it seems to me, is not in retrieving the rows, but rather how to pass the row d

Re: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread Eddie Drapkin
You could use list() a la list($foo, $bar) = mysql_fetch_row(); On Mon, Jun 15, 2009 at 4:19 PM, PJ wrote: > Jay Blanchard wrote: > > [snip] > > Is there an easier or simpler way to do this? > > [/snip] > > > > http://us2.php.net/manual/en/function.mysql-fetch-row.php > > > In what way would thi

[PHP] fopen() on a network share?

2009-06-15 Thread Brian Dunning
Running on Windows... I have a network share, \\sharename\foldername, and I want to write a file. How do I format the pathname with fopen() for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread Jay Blanchard
[snip] In what way would this simplify or ease my pain? The difficulty, it seems to me, is not in retrieving the rows, but rather how to pass the row data to the variables. And since the number of rows is variable, I believe that the only way to assign the variables is by use of a loop? I think I'm

Re: [PHP] Preventing XSS Attacks

2009-06-15 Thread Paul M Foster
On Mon, Jun 15, 2009 at 10:48:04AM -0400, Bob McConnell wrote: > From: Ashley Sheridan > > On Wed, 2009-06-10 at 18:28 +0200, Nitsan Bin-Nun wrote: > >> mysql_real_escape_string() only sanitise the input. I would > personally > >> only allow [a-zA-Z0-9-_] in search string but that's just me ;) > >

Re: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread PJ
Jay Blanchard wrote: > [snip] > In what way would this simplify or ease my pain? > The difficulty, it seems to me, is not in retrieving the rows, but > rather how to pass the row data to the variables. And since the number > of rows is variable, I believe that the only way to assign the variables >

[PHP] populate form input option dropdown box from existing data

2009-06-15 Thread PJ
I am having difficulties figuring out how enter retrieved data into a dropdown box for editing. Here's a snippet: ...snip Civilization Monuments, Temples & Tombs Pharaohs and Queens... snip As I understand it, I need to put an array ( $categoriesIN[] ) somewhere in the abo

Re: [PHP] fopen() on a network share?

2009-06-15 Thread Brian Dunning
Extra info, in case needed: my code says fopen('\\servername\sharename\folder\file.xml', 'w'); and it returns "Failed to open stream, no such file or directory". I've verified that the PHP machine does have unrestricted permissions to that share and to the directory. Thanks. On Jun 15, 20

Re: [PHP] fopen() on a network share?

2009-06-15 Thread Shawn McKenzie
Brian Dunning wrote: > Extra info, in case needed: my code says > > fopen('\\servername\sharename\folder\file.xml', 'w'); > > and it returns "Failed to open stream, no such file or directory". I've > verified that the PHP machine does have unrestricted permissions to that > share and to the direc

Re: [PHP] fopen() on a network share?

2009-06-15 Thread Andrew Ballard
On Mon, Jun 15, 2009 at 7:24 PM, Shawn McKenzie wrote: > Brian Dunning wrote: >> Extra info, in case needed: my code says >> >> fopen('\\servername\sharename\folder\file.xml', 'w'); >> >> and it returns "Failed to open stream, no such file or directory". I've >> verified that the PHP machine does h

[PHP] I2C, sending a binary byte with fwrite

2009-06-15 Thread Tobias Krieger
Hi, I'm working on a interface between the I2C Bus (Hardware) and PHP - to use the PHP as webinterface to control an I2C Device. The bus is mounted as: /dev/i2c8_aux - and works opening the bus with $fd=fopen (/dev/i2c8_aux, w (r+) (r+b) (wb))is successfull setting the address of the slave

[PHP] I2C and PHP

2009-06-15 Thread Tobias Krieger
Hi, I'm working on a interface between the I2C Bus (Hardware) and PHP - to use the PHP as webinterface to control an I2C Device. The bus is mounted as: /dev/i2c8_aux - and works opening the bus with $fd=fopen (/dev/i2c8_aux, w (r+) (r+b) (wb))is successfull setting the address of the slave

Re: [PHP] how to extract fields from associative array into different variables

2009-06-15 Thread Ashley Sheridan
On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: > Jay Blanchard wrote: > > [snip] > > In what way would this simplify or ease my pain? > > The difficulty, it seems to me, is not in retrieving the rows, but > > rather how to pass the row data to the variables. And since the number > > of rows is variab