close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

MySqli Help

Thread began 11/10/2014 9:58 am by The Flying Fox | Last modified 11/10/2014 12:47 pm by The Flying Fox | 834 views | 4 replies

The Flying Fox

MySqli Help

Hi,

We have an arena which we sell trade stand space to traders for the annual highland games. I want to allocate space to traders based on their space requirements

I have two dynamic select boxes on my page. These select boxes are for the Admin to allocate a location(pitch) that the client requires

Select One menu pulls info from two tables - the user table and product table. This then tells the admin what user requires what product!

i.e. User 15 requires product 8 - (product 8 is a pitch with the size of 15x15)

Select Two Menu pulls the info from a table that hold the pitch locations 40 pitches in total ranging in size based on the requirement for a particular year.

Once both fields have been selected this is then saved into a table with the traderID and pitchID ready for printing.

The thing I am struggling with is the SQLi code. In both select options I want the traderID and pitchID removed from the dropdowns once they have been allocated.

This did work in mySlq but I cannot get it to work in MySqli. below is my Sqlii code without the additional table. I can get it to show what pitches have been allocated but not the other way around.

<?php
$rsTraders = new WA_MySQLi_RS("rsTraders",$admin_chg,0);
$rsTraders->setQuery("SELECT tbl_traders.traderID, tbl_traders.trading_name, tbl_products.ProductSKU, tbl_products.ProductDimensions FROM tbl_traders LEFT OUTER JOIN tbl_products ON tbl_traders.pitch_req = tbl_products.ProductID WHERE tbl_traders.approved = 1");
$rsTraders->execute();
?>

this query gives all info

<?php
$rsTraders = new WA_MySQLi_RS("rsTraders",$admin_chg,0);
$rsTraders->setQuery("SELECT tbl_traders.traderID, tbl_traders.trading_name, tbl_products.ProductSKU, tbl_products.ProductDimensions, tbl_pitch_allocation.* FROM tbl_traders LEFT OUTER JOIN tbl_products ON tbl_traders.pitch_req = tbl_products.ProductID LEFT OUTER JOIN tbl_pitch_allocation ON tbl_traders.traderID = tbl_pitch_allocation.traderID WHERE tbl_traders.approved = 1");
$rsTraders->execute();
?>

I want to set it up so that the traderID is removed from the list if it exists in the table...I have been trying this for a few days with not luck.

New fresh eyes needed...I think I'm too close to the issue..

Thanks

Andy

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...