/*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 =
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.
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
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
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
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
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
) 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
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
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
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
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
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
/*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
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
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
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
]
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
?
//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
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
() 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
' 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
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
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
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,
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
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
:[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
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
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
(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
]
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
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
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
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
35 matches
Mail list logo