Re: [PHP] Insert group by

2012-04-27 Thread Lester Caine
Rick Dwyer wrote: This is more of a MySQL question, but I'm hoping it can be answered here. On one of my pages, I issue a SQL command to group data as such: $sql='select count(*) as count, searchkeywords from searchkeywords group by searchkeywords order by count desc' Works well... but I

RE: [PHP] Insert group by

2012-04-27 Thread admin
] Sent: Thursday, April 26, 2012 8:23 PM To: PHP-General Subject: [PHP] Insert group by Hello all. This is more of a MySQL question, but I'm hoping it can be answered here. On one of my pages, I issue a SQL command to group data as such: $sql='select count(*) as count, searchkeywords from

[PHP] Insert group by

2012-04-26 Thread Rick Dwyer
Hello all. This is more of a MySQL question, but I'm hoping it can be answered here. On one of my pages, I issue a SQL command to group data as such: $sql='select count(*) as count, searchkeywords from searchkeywords group by searchkeywords order by count desc' Works well... but I would like

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-28 Thread Adam Richardson
On Mon, Feb 27, 2012 at 9:12 PM, Micky Hulse mickyhulse.li...@gmail.comwrote: Howdy! Example code: https://gist.github.com/1928452 What would be the best way to insert $o_insert array into $o array after specified key? I hate to just ask for example code, but I can't seem to find the

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-28 Thread Micky Hulse
Hi Adam! On Tue, Feb 28, 2012 at 2:05 PM, Adam Richardson simples...@gmail.com wrote: What would be the best way to insert $o_insert array into $o array after specified key? Great question. :D Quick answer: It's a Wordpress thang! Long answer: I am working with WordPress and the theme that I

[PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Micky Hulse
Howdy! Example code: https://gist.github.com/1928452 What would be the best way to insert $o_insert array into $o array after specified key? I hate to just ask for example code, but I can't seem to find the perfect solution. :( Many thanks in advance for the help! Cheers, Micky -- PHP

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Eray Alakese
$newarray = array() ; foreach($o as $key = $val) { if($prevkey != 'specifickey') { $prevkey = $key; $newarray[$key] = $val; } else $newarray[] = $o_insert; } i think this would help you. i can't test it, I'm sending this from mobile phone :-) Eray Alakese 28 Şub

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Micky Hulse
Thank you Eray! That's a cool approach. Testing code now. I will be back with my results. :) Thank you!!! Cheers, M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread xucheng
Maybe you can trans the array into a xml tree , then modify its leaves . RTFSC - Read The F**king Source Code :)! 2012/2/28 Micky Hulse mickyhulse.li...@gmail.com Thank you Eray! That's a cool approach. Testing code now. I will be back with my results. :) Thank you!!! Cheers, M --

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Micky Hulse
Hi Xucheng, On Mon, Feb 27, 2012 at 7:41 PM, xucheng helloworldje...@gmail.com wrote: Maybe you can trans the array into a xml tree , then modify its leaves . Now that sounds like an interesting idea... I will have to research that as an option. Thanks for tip! :) @Eray, I was not able to get

[PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
I have a code that i get the $_POST's result and then insert them in tables of Mysql it can run without error but it'll insert in the table twice and i don't know why. when I click the submit then with array_key_exists I go to if statement and insert it. i'll show the code if someone have time

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Lester Caine
Negin Nickparsa wrote: I have a code that i get the $_POST's result and then insert them in tables of Mysql it can run without error but it'll insert in the table twice and i don't know why. when I click the submit then with array_key_exists I go to if statement and insert it. i'll show the code

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
Consistently here is the code: ?php session_start(); $connection=Mysql_connect('localhost','admin','123'); Mysql_select_db('db',$connection); if(array_key_exists('sub',$_POST)$_POST['sub']=='Register') { $str=$_POST['uname']; $str2=$_POST['pass1']; $str3=$_POST['pname']; $str4=$_POST['lname'];

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
I click the submit button just one time! not twice but when i go to MySql and select * from it it shows me happening two times

Re: [PHP] insert to table in php scripts

2011-05-28 Thread viraj
hi negin, do you get duplicate inserts into both tables? if yes, try an 'exit();' right after the success message; echo you have been registered successfully!; exit(); this will stop the script after the message, and you wont see the form either. at this point check the tables for duplicate

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
Hi viraj intresting! i changed the code to this: $kind=$_SESSION['s3']; $query1=insert into user(kind,user,pass,name)values('$kind','$str','$str2','$str3'); $result1=mysql_query($query1); i set the session in my another page and now it works properly:D LOL!!

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
Yes viraj it was in both tables

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
i used your exit too,yes it's better to hide the form after registration:)

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Lester Caine
Negin Nickparsa wrote: I click the submit button just one time! not twice but when i go to MySql and select * from it it shows me happening two times The code looks OK, so something is hitting it twice. I normally have a unique index on anything that I do not want duplicates in - which would

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
i'm wondering that what was the problem! why with just a session it now works propely!!! how!

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Igor Konforti
But why do you double-post your question? http://news.php.net/php.general/313198 ? On Sat, May 28, 2011 at 11:21, Negin Nickparsa nickpa...@gmail.com wrote: i'm wondering that what was the problem! why with just a session it now works propely!!! how!

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
cause it's in another topic!!! and another problem! this problem was solved i had another problem what do you mean!?

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
in this topic problem WAS this one: insert to a table twice(that was solved) and on that post problem is this one: working with echo html then insert to a table (problem in $_POST) I thought it is very different am i wrong?

Re: [PHP] insert to table in php scripts

2011-05-28 Thread viraj
hi nigen, the intention of that 'exit' was to stop the script temporarily to avoid any second time inserts. i think you better figure-out what caused your script to insert same data twice in a single form post. to hide the form, 'exit' is not the best option. there are several different ways, one

Re: [PHP] insert to table in php scripts

2011-05-28 Thread Negin Nickparsa
Thanks Viraj,I'll read it.

[PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Allen McCabe
Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously upload an image file (and store the path in the table). I have accomplished this with a product-based system (adding products and uploading images of the product),

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Mari Masuda
Maybe you could use http://us.php.net/manual/en/function.mysql-insert-id.php to get the inserted id. On Oct 28, 2009, at 12:21 PM, Allen McCabe wrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously upload

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Ashley Sheridan
On Wed, 2009-10-28 at 12:21 -0700, Allen McCabe wrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously upload an image file (and store the path in the table). I have accomplished this with a product-based

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Floyd Resler
Allen, Use mysql_insert_id(). This will return the id of the last record inserted. Take care, Floyd On Oct 28, 2009, at 3:21 PM, Allen McCabe wrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Martin Scotta
On Wed, Oct 28, 2009 at 4:21 PM, Allen McCabe allenmcc...@gmail.com wrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL database and simultaneously upload an image file (and store the path in the table). I have accomplished this

[PHP] Re: [php] INSERT and immediately UPDATE

2009-10-28 Thread Jo�o C�ndido de Souza Neto
Use mysql_insert_id() instead of the select you´re using now. Allen McCabe allenmcc...@gmail.com escreveu na mensagem news:657acef20910281221y5ab6ab7t4882f4f00da2c...@mail.gmail.com... Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our MySQL

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Allen McCabe
You all are great! Thank you so much. On Wed, Oct 28, 2009 at 12:27 PM, Martin Scotta martinsco...@gmail.comwrote: On Wed, Oct 28, 2009 at 4:21 PM, Allen McCabe allenmcc...@gmail.comwrote: Hey everyone, I have an issue. I need my (employee) users to be able to insert shows into the our

[PHP] Insert Symbol into Mysql

2009-09-16 Thread Samrat Kar
I want to insert symbols like degree, plusminus, currency along with string into Mysql database. Front is HTML form with javascript. Server side scripts are written in PHP. Please help. Regards, Samrat Kar

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
, the MySQL table charset, the way you store/retrieve data into MySQL, etc etc ... we can help but we need more info From: esam...@barc.gov.in To: php-general@lists.php.net Date: Wed, 16 Sep 2009 17:00:31 +0530 Subject: [PHP] Insert Symbol into Mysql I want to insert symbols like degree

Re: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar wrote: I want to insert symbols like degree, plusminus, currency along with string into Mysql database. Front is HTML form with javascript. Server side scripts are written in PHP. Please help. Regards, Samrat Kar Two ways to do

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
He has no utf-8 charset in the table, so the first point is valid and htmlentities is the function ( http://uk.php.net/manual/en/function.htmlentities.php ) You need to remember that in this way you need to use htmlentities for *everything*, specially for searches, otherwise ° against #176;

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 14:47 +0200, Andrea Giammarchi wrote: He has no utf-8 charset in the table, so the first point is valid and htmlentities is the function ( http://uk.php.net/manual/en/function.htmlentities.php ) You need to remember that in this way you need to use htmlentities for

Re: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Jo�o C�ndido de Souza Neto
If he´s really using a any other charset instead of utf8 table, why not using utf8_decode and utf8_decode in his php files to solve this? Ashley Sheridan a...@ashleysheridan.co.uk escreveu na mensagem news:1253101315.2275.4.ca...@localhost... On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
I don't recall him saying that a utf8 table was not an option or that he wasn't using one. I know 'cause he replied directly to me rather than this ML Also, try not to top post ;) I usually hate scroll 'till the end to find often a single row as reply ... I'll try though Thanks,

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
If he´s really using a any other charset instead of utf8 table, why not using utf8_decode and utf8_decode in his php files to solve this? let's say PHP could have a different charset than the one defined in that MySQL table so this is not a portable solution, specially if you do not

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 15:40 +0200, Andrea Giammarchi wrote: I don't recall him saying that a utf8 table was not an option or that he wasn't using one. I know 'cause he replied directly to me rather than this ML Also, try not to top post ;) I usually hate scroll 'till the end to

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
Yeah, the rules say to snip out parts of the convo which aren't pertinent, but I know I don't exactly follow that one either! :-/ Thanks, Ash http://www.ashleysheridan.co.uk to be honest the problem is that I am in hotmail rather than gmail here, and this page is not clever as gmail one

Re: [PHP] insert array values

2009-03-08 Thread Jim Lucas
PJ wrote: Jim Lucas wrote: PJ wrote: 9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql =

Re: [PHP] insert array values

2009-03-08 Thread PJ
Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well... basically as I thought it should go with a little help from my friends, here on the list :-) many of my problems were small omissions and /or typos and misplaced

Re: [PHP] insert array values

2009-03-08 Thread Ashley Sheridan
On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well... basically as I thought it should go with a little help from my friends, here on the list :-) many of my problems

Re: [PHP] insert array values

2009-03-08 Thread PJ
Ashley Sheridan wrote: On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well... basically as I thought it should go with a little help from my friends, here on the list

Re: [PHP] insert array values

2009-03-08 Thread Ashley Sheridan
On Sun, 2009-03-08 at 17:52 -0500, PJ wrote: Ashley Sheridan wrote: On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well... basically as I thought it should go

Re: [PHP] insert array values

2009-03-08 Thread PJ
Ashley Sheridan wrote: On Sun, 2009-03-08 at 17:52 -0500, PJ wrote: Ashley Sheridan wrote: On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well...

Re: [PHP] insert array values

2009-03-07 Thread PJ
Jim Lucas wrote: PJ wrote: 9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT

Re: [PHP] insert array values

2009-03-07 Thread PJ
Jim Lucas wrote: PJ wrote: 9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT INTO book_categories (

[PHP] insert array values

2009-03-06 Thread PJ
I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I can't quite manage to insert the data which is just id numbers for a table. I've tried some while stuff but doesn't work. I know I don't have the

Re: [PHP] insert array values

2009-03-06 Thread Bastien Koert
On Fri, Mar 6, 2009 at 4:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I can't quite manage to insert the data which is just id numbers for a table.

Re: [PHP] insert array values

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I can't quite manage to insert the data which is just id numbers for a table.

Re: [PHP] insert array values

2009-03-06 Thread PJ
Bastien Koert wrote: On Fri, Mar 6, 2009 at 4:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I can't quite manage to insert the data which is

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: On Fri, Mar 6, 2009 at 3:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I can't quite manage to insert the data which is just id

Re: [PHP] insert array values

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 4:07 PM, PJ af.gour...@videotron.ca wrote: haliphax wrote: On Fri, Mar 6, 2009 at 3:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: On Fri, Mar 6, 2009 at 4:07 PM, PJ af.gour...@videotron.ca wrote: haliphax wrote: On Fri, Mar 6, 2009 at 3:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: On Fri, Mar 6, 2009 at 4:07 PM, PJ af.gour...@videotron.ca wrote: haliphax wrote: On Fri, Mar 6, 2009 at 3:00 PM, PJ af.gour...@videotron.ca wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array

Re: [PHP] insert array values

2009-03-06 Thread PJ
I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT INTO book_categories ( book_id, category ) VALUES( '$autoID', '$categoriesID[0]' ), ( '$autoID', '$categoriesID[1]' ), ( '$autoID', '$categoriesID[2]'

Re: [PHP] insert array values

2009-03-06 Thread 9el
On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT INTO book_categories ( book_id, category ) VALUES( '$autoID', '$categoriesID[0]' ), (

Re: [PHP] insert array values

2009-03-06 Thread PJ
9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT INTO book_categories ( book_id,

Re: [PHP] insert array values

2009-03-06 Thread Jim Lucas
PJ wrote: 9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = INSERT INTO book_categories (

[PHP] insert text with no specific format into database table

2008-02-25 Thread jeffry s
i have text file and a table created with create table word( id int not null auto_increment primary key, word varchar(50), definition text ) the text contain list of words but not really in specific format word, some text definition word, some text definition, some text definition, etc i want

Re: [PHP] insert text with no specific format into database table

2008-02-25 Thread Daniel Brown
On Mon, Feb 25, 2008 at 8:35 AM, jeffry s [EMAIL PROTECTED] wrote: i have text file and a table created with create table word( id int not null auto_increment primary key, word varchar(50), definition text ) Look into the PHP function fgetcsv(). -- /Dan Daniel P. Brown Senior

[PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Adam Williams
In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql after being ran through mysql_real_escape_string(), it

Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread afan pasalic
Adam Williams wrote: In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql after being ran through

Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread David Giragosian
On 1/3/08, Adam Williams [EMAIL PROTECTED] wrote: In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql after

Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Brady Mitchell
when I type the word blah's to my text box variable, and then insert it into mysql after being ran through mysql_real_escape_string(), it does: insert into contract (contract_id, responsibility) VALUES (15, 'blah\\\'s') It looks like magic quotes is turned on. Take a look at

Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 1:22 pm, Adam Williams wrote: In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql

RE: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Bastien Koert
-general@lists.php.net Subject: [PHP] handling ' with mysql/php insert and select In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable

[PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Rahul S. Johari
Ave, Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys = Values. I¹m using foreach() to read the Keys = Values like this: function pr1($var) { foreach ($var as $k = $v) { echo ³$k = $v²; } I need to INSERT the Values from this

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Rahul S. Johari wrote: Ave, Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys = Values. I¹m using foreach() to read the Keys = Values like this: function pr1($var) { foreach ($var as $k = $v) { echo ³$k = $v²; } I need to

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread David Giragosian
On 5/2/07, Rahul S. Johari [EMAIL PROTECTED] wrote: Ave, Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys = Values. I¹m using foreach() to read the Keys = Values like this: function pr1($var) { foreach ($var as $k = $v) { echo ³$k = $v²;

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Jim Moseby
$sql = INSERT INTO table (f1, f2, f3, . implode(,, array_keys($pr1)) .) VALUES ('abc', '123', '456', . implode(,, array_values($pr1)) .); HTH, Brad Might not work if the array values need to be enclosed in quotes. I would build the query string in a foreach loop and

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Rahul Sitaram Johari
Ave, I was just about to post when I saw your message. I think what you're saying is exactly what is happening. The values have Spaces and stuff so Quotes are Required - cannot have values not enclosed in Quotes. Other then that it was actually working. Is there a way to enclose in Quotes using

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Jim Moseby wrote: $sql = INSERT INTO table (f1, f2, f3, . implode(,, array_keys($pr1)) .) VALUES ('abc', '123', '456', . implode(,, array_values($pr1)) .); HTH, Brad Might not work if the array values need to be enclosed in quotes. I would build the query string in a

Re: [PHP] INSERT Array Values into mySQL Table - SOLVED!

2007-05-02 Thread Rahul Sitaram Johari
WORKS Like A Charm!! :) Thanks. On 5/2/07 12:14 PM, Brad Fuller [EMAIL PROTECTED] wrote: Jim Moseby wrote: $sql = INSERT INTO table (f1, f2, f3, . implode(,, array_keys($pr1)) .) VALUES ('abc', '123', '456', . implode(,, array_values($pr1)) .); HTH, Brad Might not work if the

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 11:03 am, Jim Moseby wrote: $sql = INSERT INTO table (f1, f2, f3, . implode(,, array_keys($pr1)) .) VALUES ('abc', '123', '456', . implode(,, array_values($pr1)) .); HTH, Brad Might not work if the array values need to be enclosed in quotes. I would

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 10:42 am, Rahul S. Johari wrote: Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys = Values. I¹m using foreach() to read the Keys = Values like this: //note added arguments! function pr1($var, $var2, $var3) { foreach ($var as $k = $v) {

RE: [PHP] insert html into php variable

2007-02-12 Thread Edward Kay
I am using phpmailer for a rich html mailer and I have been using lines like this to build up the mailbody $mail_body .= div align=\center\img src=\http://www.myurl.org/mylogo.gif\;; Is there a build in function to assign html code to a php variable and then output them? Or can I read

RE: [PHP] insert html into php variable

2007-02-12 Thread Robert Cummings
On Mon, 2007-02-12 at 12:27 +, Edward Kay wrote: I am using phpmailer for a rich html mailer and I have been using lines like this to build up the mailbody $mail_body .= div align=\center\img src=\http://www.myurl.org/mylogo.gif\;; Is there a build in function to assign html

Re: [PHP] insert html into php variable

2007-02-12 Thread clive
?php ob_start(); include( 'someFile.php' ); $content = ob_get_contents(); ob_end_clean(); ? no I think he needs file_get_contents(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] insert html into php variable

2007-02-12 Thread Robert Cummings
On Mon, 2007-02-12 at 14:52 +0200, clive wrote: ?php ob_start(); include( 'someFile.php' ); $content = ob_get_contents(); ob_end_clean(); ? no I think he needs file_get_contents(); While that will certainly read PHP into a variable, it won't evaluate the

RE: [PHP] insert html into php variable

2007-02-12 Thread Edward Kay
I am using phpmailer for a rich html mailer and I have been using lines like this to build up the mailbody $mail_body .= div align=\center\img src=\http://www.myurl.org/mylogo.gif\;; Is there a build in function to assign html code to a php variable and then output

Re: [PHP] insert html into php variable

2007-02-12 Thread clive
Robert Cummings wrote: On Mon, 2007-02-12 at 14:52 +0200, clive wrote: ?php ob_start(); include( 'someFile.php' ); $content = ob_get_contents(); ob_end_clean(); ? no I think he needs file_get_contents(); While that will certainly read PHP into a variable, it won't evaluate

RE: [PHP] insert html into php variable

2007-02-12 Thread Robert Cummings
On Mon, 2007-02-12 at 13:20 +, Edward Kay wrote: I am using phpmailer for a rich html mailer and I have been using lines like this to build up the mailbody $mail_body .= div align=\center\img src=\http://www.myurl.org/mylogo.gif\;; Is there a build in function

Re: [PHP] insert html into php variable

2007-02-12 Thread Robert Cummings
On Mon, 2007-02-12 at 15:20 +0200, clive wrote: Robert Cummings wrote: On Mon, 2007-02-12 at 14:52 +0200, clive wrote: ?php ob_start(); include( 'someFile.php' ); $content = ob_get_contents(); ob_end_clean(); ? no I think he needs file_get_contents();

Re: [PHP] insert html into php variable

2007-02-12 Thread Sancar Saran
Hi, If I understood your questions here my solution. Tip: Do not use in html files... externalFile.php ?php $strExternal = ''; for($i=0;$icount($arrData);$i++) { $strExternal.= trtd.$arrData[$i]['foo']. .$arrData[$i]['bar']. .$arrData[$i] ['baz']./td/tr\n; } ? mailFile.php ?php

Re: [PHP] insert to DB

2005-12-26 Thread adriano ghezzi
pls could you point out which instruction should insert record in db thanks... 2005/12/18, Anasta [EMAIL PROTECTED]: It just wont insert new data into DB--any ideas as i have gone over and over. ? mysql_connect(localhost,anasta,silteren); mysql_select_db(mytipperv1); if(!isset($cmd))

[PHP] insert to DB

2005-12-18 Thread Anasta
It just wont insert new data into DB--any ideas as i have gone over and over. ? mysql_connect(localhost,anasta,silteren); mysql_select_db(mytipperv1); if(!isset($cmd)) { $result = mysql_query(select * from leaderboard order by ID); while($r=mysql_fetch_array($result)) {

Re: [PHP] insert to DB

2005-12-18 Thread Brian V Bonini
On Sun, 2005-12-18 at 07:41, Anasta wrote: It just wont insert new data into DB--any ideas as i have gone over and over. Your not doing any inserts, two selects and one update... insert in t1 values('foo','bar','1 1 2 3 5 8 13'); -- s/:-[(/]/:-)/g BrianGnuPG - KeyID: 0x04A4F0DC

Re: [PHP] insert to DB

2005-12-18 Thread Zareef Ahmed
/mysql_ref.php Zareef Ahmed - Original Message - From: Anasta [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Sunday, December 18, 2005 7:41 AM Subject: [PHP] insert to DB It just wont insert new data into DB--any ideas as i have gone over and over. ? mysql_connect

Re: [PHP] Insert one or many chekbox values in a db mysql

2005-08-10 Thread Greg Schnippel
Try this article on Evolt: http://www.evolt.org/article/Storing_form_array_data_to_MySQL_using_PHP/18/60222/ that covers the whole process with good code examples.. - schnippy On 8/9/05, Jesús Alain Rodríguez Santos [EMAIL PROTECTED] wrote: Hi, I have 5 chekboxes in a page, I would like

Re: [PHP] Insert one or many chekbox values in a db mysql

2005-08-10 Thread John Nichel
Jesús Alain Rodríguez Santos wrote: Hi, I have 5 chekboxes in a page, I would like insert the values of all chekboxes checked in a mysql db. Okay, have fun. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To

[PHP] Insert one or many chekbox values in a db mysql

2005-08-09 Thread Jesús Alain Rodríguez Santos
Hi, I have 5 chekboxes in a page, I would like insert the values of all chekboxes checked in a mysql db. -- Este mensaje ha sido analizado por MailScanner en busca de virus y otros contenidos peligrosos, y se considera que está limpio. -- PHP General Mailing List (http://www.php.net/) To

[PHP] insert not working

2005-05-05 Thread Ross
$query = INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax', '$email',

Re: [PHP] insert not working

2005-05-05 Thread Marek Kilimajer
Ross wrote: $query = INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city', '$telephone', '$mobile', '$fax',

Re: [PHP] insert not working

2005-05-05 Thread Prathaban Mookiah
Did you check for proper permissions in the user and db tables in the user database? Prathap -- Original Message --- From: Ross [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thu, 5 May 2005 10:15:52 +0100 Subject: [PHP] insert not working $query = INSERT INTO sheet1

Re: [PHP] insert not working

2005-05-05 Thread bala chandar
Hi, On 5/5/05, Ross [EMAIL PROTECTED] wrote: $query = INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web, add_info) VALUES ('$title', '$fname', '$sname', '$job_title', '$organisation', '$street', '$postcode', '$city',

RE: [PHP] insert not working

2005-05-05 Thread Mark Rees
-Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: 05 May 2005 10:16 To: php-general@lists.php.net Subject: [PHP] insert not working $query = INSERT INTO sheet1 (title, fname, sname, job_title, organisation, street, postcode, city, telephone, mobile, fax, email, web

  1   2   3   >