Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Well, it took me all evening to figure it out, but I did. The SQL statement needed to be changed to WHERE categories LIKE '%$cat%' and now it works. I had found an old book on my shelf called "MySQL and Perl for the Web" and found an example in there that pointed me in the right direction

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
I've run up against something else here that I can't find an answer for. This line of the script: $cats = array('01100-01200-01300-06403' => 'Starter Units', '01100-02201-01300-06403' => 'Add-On Units', '01100-99222-11341-18451' => 'Extra Shelves'); is supposed to pull all items from ea

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
On Aug 4, 2009, at 12:33 PM, Ben Dunlap wrote: I don't follow what you mean by "it gets sent for every itemid" -- can you post an example of the query string that's being generated? Well, do I feel stupid. I thought I had moved it to the correct spot but I hadn't. When value="viewcart.

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread Ben Dunlap
> Sorry... I'm using GET. I have used the code you supplied below, > but as I mentioned, it gets sent for every itemid in the table. I needs > to be sent only once, and right after the action. That's where I'm > stumped. Hidden form inputs should work with GET or POST -- they're only "hidde

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread Jerry Wilborn
I re-read your original thread, and I think *now* I may know what you're asking. Bastien is right, you're not going to be able to selectively send data to PHP with just HTML. Be careful though, as 'GET' has its limits. POST has limits as well, but for adding items to a shopping cart you're unlikel

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Sorry... I'm using GET. I have used the code you supplied below, but as I mentioned, it gets sent for every itemid in the table. I needs to be sent only once, and right after the action. That's where I'm stumped. Frank On Aug 4, 2009, at 11:56 AM, Jerry Wilborn wrote: If the form meth

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread Jerry Wilborn
If the form method is "POST" then set the 'c' variable with a hidden value within the form: Jerry Wilborn jerrywilb...@gmail.com On Tue, Aug 4, 2009 at 1:50 PM, wrote: > > On Aug 4, 2009, at 9:43 AM, Jerry Wilborn wrote: > > Keep in mind that you can use name=var[] value=value1, name=var[] >>

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
On Aug 4, 2009, at 9:43 AM, Jerry Wilborn wrote: Keep in mind that you can use name=var[] value=value1, name=var[] value=value2 and php will create an array as $_REQUEST['var'] with each of your values. The keys are numbered and don't count on what order they'll come through. Thanks for

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread Jerry Wilborn
Keep in mind that you can use name=var[] value=value1, name=var[] value=value2 and php will create an array as $_REQUEST['var'] with each of your values. The keys are numbered and don't count on what order they'll come through. Jerry Wilborn jerrywilb...@gmail.com On Tue, Aug 4, 2009 at 10:47 AM,

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread Bastien Koert
On Tue, Aug 4, 2009 at 11:40 AM, wrote: >        Is what I'm looking to do not possible in PHP?  I've come close with > a JavaScript version, but I'd rather not rely on everyone having JS turned > on.  Or am I stuck having to use JS? > > Thanks again, > Frank > > >>        I'd like to revisit this

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Is what I'm looking to do not possible in PHP? I've come close with a JavaScript version, but I'd rather not rely on everyone having JS turned on. Or am I stuck having to use JS? Thanks again, Frank I'd like to revisit this one last time. Below is the revised code I'm using, but I do

Re: [PHP] Multiple MySQL Queries

2009-08-03 Thread sono-io
I'd like to revisit this one last time. Below is the revised code I'm using, but I don't like having individual 'Add To Cart' buttons for each item. I've tried to find a way to have only one that resides outside the nested tables for all items, but without luck. It would need to send ev

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 4:38 PM, Jim Lucas wrote: I saw your other email before sending. The problem with the way you show you want it there is that each result set would have to be the same size. I'm going to assume that they won't be... Well, they SHOULD be but you never know. Thanks for

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread Jim Lucas
sono...@fannullone.us wrote: > > On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote: > >> > $item_list = ""; >> $cats = array('01100-01200-01300-06403', '01100-02201-01300-06403'); >> >> echo ''; >> echo ''; >> foreach ( $cats AS $cat ) { >> echo ''.htmlspecialchars($cat).''; >> } >> echo ''; >> f

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote: '; echo ''; foreach ( $cats AS $cat ) { echo ''.htmlspecialchars($cat).''; } echo ''; foreach ( $cats AS $cat ) { echo ''; $cat = mysql_real_escape_string($cat, $db); $SQL = "SELECT itemid,description,unitprice

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote: '; echo ''; foreach ( $cats AS $cat ) { echo ''.htmlspecialchars($cat).''; } echo ''; foreach ( $cats AS $cat ) { echo ''; $cat = mysql_real_escape_string($cat, $db); $SQL = "SELECT itemid,description,unitprice

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread Jim Lucas
Please, click "Reply All" so the list may benefit from our talking. Read below for further information. sono...@fannullone.us wrote: > Jim, > >> if ( ( $results = mysql_query($SQL, $db) ) !== false ) { >> >> You want to have the inner portion processed then the comparison done. >> Not the other

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread Jim Lucas
sono...@fannullone.us wrote: > Hi Jim, > >> Take a look inside your money_format() function look for the problem. > > I apologize for replying too quickly. > > The money_format() function looks just like the one I had before, so > that's fine. > > Upon closer inspection, I found a f

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread Jim Lucas
Bastien Koert wrote: > On Tue, Jul 28, 2009 at 10:11 AM, wrote: >>This may be more of a MySQL question than PHP, but I'm hoping someone >> can point me in the right direction. I have working code (below) that pulls >> data from a particular category in our db. I'd like to be able to pull

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread Bastien Koert
On Tue, Jul 28, 2009 at 10:11 AM, wrote: >        This may be more of a MySQL question than PHP, but I'm hoping someone > can point me in the right direction.  I have working code (below) that pulls > data from a particular category in our db.  I'd like to be able to pull data > from multiple cate

[PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
This may be more of a MySQL question than PHP, but I'm hoping someone can point me in the right direction. I have working code (below) that pulls data from a particular category in our db. I'd like to be able to pull data from multiple categories in the same db and place them on the same