[PHP] PHP MySQL Insert Syntax

2008-04-01 Thread kvigor
/*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in other columns*/ Code: foreach($list as $key=$value) { $query =

Re: [PHP] PHP MySQL Insert Syntax

2008-04-01 Thread kvigor
Thanks :-) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Insert is for a new row Alter or Update is for an exsisting row /*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table.

[PHP] magic quotes

2007-07-31 Thread KVIGOR
If magic quotes is on and I dont have access to the php.ini. Is there any way I can strip quotes from the form field with out using AJAX? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: magic quotes

2007-07-31 Thread KVIGOR
Never Mind I figured it out. KVIGOR [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If magic quotes is on and I dont have access to the php.ini. Is there any way I can strip quotes from the form field with out using AJAX? -- PHP General Mailing List (http://www.php.net

[PHP] If MySQL column/field values are in an PHP array

2007-07-19 Thread kvigor
I created an array using the following: $in_list = '.join(',',$cen_chiefs).'; //$cen_chiefs is an array $query_cen_chiefs = SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) IN({$in_list}); How would I go about adding an AND clause to the above query to return all rows

[PHP] Re: If MySQL column/field values are in an PHP array

2007-07-19 Thread kvigor
PROTECTED] kvigor wrote: I created an array using the following: $in_list = '.join(',',$cen_chiefs).'; //$cen_chiefs is an array $query_cen_chiefs = SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) IN({$in_list}); How would I go about adding an AND clause to the above query

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-18 Thread kvigor
suggestions? Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] K. Hayes wrote: Will do. Thanks. - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Saturday, June 30, 2007 1:46 AM Subject: Re: [PHP

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-18 Thread kvigor
) IN({$in_list}) ORDER BY conName; Any suggestions? Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row

Re: [PHP] Array Question

2007-07-17 Thread kvigor
Thanks for all the input. You've all been pretty informative. Sorry of delayed response to help but was busy. You all are appreciated. Stut [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to

Re: [PHP] Checking Post Data against DB Data

2007-07-17 Thread kvigor
I really like the re-coding it's great. I'm still new and below code is definitely more efficient. FYI: I do have date field sorry I wasn't so clear. I just didn't post all code. Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Doing a select to get every record, and

[PHP] Array Question

2007-07-11 Thread kvigor
Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big horse;$var2 = small yellow;$var3 = red hydrant; $theArray = array(big blue horse, small yellow bird, giant red hydrant); Is there a way to find out if $var1

Re: [PHP] Checking Post Data against DB Data

2007-07-11 Thread kvigor
OK Chris, I understand that we're checking checking the form data and escaping it, but can explain what's going on in the WHERE clause and 1=1 tad bit more. Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: /*Good Morning to All, I am having an issue

Re: [PHP] Array Question

2007-07-11 Thread kvigor
Thanks, I've seen the light by your code. Robin Vickery [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big

[PHP] Checking Post Data against DB Data

2007-07-10 Thread kvigor
/*Good Morning to All, I am having an issue with the following code. I'm trying to match $newRegistrant(which is concatenated form data) with $oldRegistrant(which is concatenated DB data). The code is suppose to check if the Registrants match, if they do, then check if last registration was

[PHP] Reading Error: socket '/var/lib/mysql/mysql.sock'

2007-07-06 Thread kvigor
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) FYI I did this to solved the problem but it didn't work: http://webyog.com/forums/lofiversion/index.php/t1367.html the only thing is that I'm running MySQL 5.0 (I have a my.ini not my.cfg) and I put the var

[PHP] Re: Reading Error: socket '/var/lib/mysql/mysql.sock'

2007-07-06 Thread kvigor
PROBLEM SOLVED had wrong db connection file on HOST SERVER. kvigor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) FYI I did this to solved the problem but it didn't work: http://webyog.com

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-05 Thread kvigor
will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: where is the part that it join()'s things together? it's: $in_list = '.join(',',$list).'; Good what is the output of the join() call

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-04 Thread kvigor
] kvigor wrote: Jim, Thanks for all you help. Tell me where to mail you the check seriously. If we get this right I'll owe you. OK, the query string now looks like you said it would. However Query isn't returning a match. //DETAILS= My

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-03 Thread kvigor
? //END DETAILS== Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: Ok Jim, This is what I have so far and I'm still working it out. $in_list = .join('',$someArrayList); // do I really need

[PHP] Removing Spaces from Array Values

2007-07-02 Thread kvigor
Need to remove all spaces from Array Values... And this doesn't work. This is similar info that's within array values: $someArray[0] = PHP is awesome;s/b PHPisawesome This is similar info that's within array values: $someArray[1] = The Toy Boat;s/b TheToyBoat Begin

Re: [PHP] Removing Spaces from Array Values

2007-07-02 Thread kvigor
() returns the desired string. Try changing your code to: for($num = 0; $cntr $num; $cntr++) { $someArray[$num] = str_replace(' ','',$someArray[$num]); echo $someArray[$num]br /; } http://us.php.net/manual/en/function.str-replace.php Adam kvigor wrote: Need to remove all spaces

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-02 Thread kvigor
' in 'where clause'// where am I going wrong? == Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: Jim, Please excuse the ignorance, I'm a newbie, but I'm only use to simple SELECT, INSERT

Re: [PHP] Removing Spaces from Array Values

2007-07-02 Thread kvigor
I meant to say: Got It, My bad, I really feel SHEEPISH... should have done... This is what happens when you're trying to code with a migraine, You start speaking another language. Thanks Again kvigor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Got I'm my bad I really feel

Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-01 Thread kvigor
PROTECTED] wrote in message news:[EMAIL PROTECTED] K. Hayes wrote: Will do. Thanks. - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Saturday, June 30, 2007 1:46 AM Subject: Re: [PHP] Selecting Rows Based on Row

[PHP] Selecting Rows Based on Row Values Being in Array

2007-06-29 Thread kvigor
Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs,

[PHP] Convert Date time into Seconds

2007-06-23 Thread kvigor
Good Day, I'm chech if 24hrs has passed between these 2 datetimes: $dTime1 = 2007-06-21 11:08:09; $dTime2 = 2007-06-22 07:08:09; I'd really like to convert the datetimes above into a format I can do regular math them. Browsing around I've found the following code. But both weren't clear on

Re: [PHP] Convert Date time into Seconds

2007-06-23 Thread kvigor
Cool, Like Ambien, It worked like a dream. Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sat, 2007-06-23 at 21:29 -0500, kvigor wrote: Good Day, I'm chech if 24hrs has passed between these 2 datetimes: $dTime1 = 2007-06-21 11:08:09; $dTime2 = 2007-06-22

[PHP] Re: Not getting expected result from file()

2007-06-11 Thread kvigor
:[EMAIL PROTECTED] kvigor wrote: Hello, I'm using the file function create an array. I'm using a value from a form to see if it matches in elements in the array. My problem is I expect the condition to be true but info but my DB isn't populated as I in the right DB... =Code

[PHP] Not getting expected result from file()

2007-06-10 Thread kvigor
Hello, I'm using the file function create an array. I'm using a value from a form to see if it matches in elements in the array. My problem is I expect the condition to be true but info but my DB isn't populated as I in the right DB... =Code

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
Sorry I re-wrote for problem clarity. FYI whenever I do a var_dump it always shows $stringOne as being 2 characters less e.g. var_dump($foodlandPA[45]); var_dump($storeInfo); string(31) Wellston Foodland Wellston OH string(29) Wellston Foodland Wellston OH kvigor [EMAIL PROTECTED] wrote

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
(Query failed: . mysql_error($connection)); } = David Robley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: Hello, I'm using the file function create an array. I'm using a value from a form to see if it matches in elements

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
] kvigor wrote: Hello, I'm using the file function create an array. I'm using a value from a form to see if it matches in elements in the array. My problem is I expect the condition to be true but info but my DB isn't populated as I in the right DB... =Code Begins

Re: [PHP] Cant set info in DB...HELP

2007-06-03 Thread kvigor
Thanks All. Made the changes and just like Ambien it worked like a Dream. I found out that I had a typo in my DB and missing ) I corrected it. All is well. Tijnema wrote in message news:[EMAIL PROTECTED] On 6/3/07, Stut [EMAIL PROTECTED] wrote: K. Hayes wrote: What lists are you referring

[PHP] Cant set info in DB...HELP

2007-06-01 Thread kvigor
Hello, I'm using phpMyAdmin and I can't get any of my form data into the database. It returns message: MySQL returned an empty result set w/in phpMyAdmin GUI. However I get no errors on screen when form info is submitted. What I have done to solve issue: drop DB and create new. Review form

Re: [PHP] Form Validation Issues

2007-05-23 Thread kvigor
Thanks Dan, Work like a dream. I solute you. Daniel Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 5/23/07, kvigor [EMAIL PROTECTED] wrote: Hi, I have an issue with a particular if statement when I check 3 form fields for their value. The problem is no matter what