Username:
Password:
Search for Plugins: Advanced
Please Sign in, Register or Resend Activation Email

Forums

  e107 Coders.org :: Forums :: E107 Plugins :: Code Bank
 
<< Previous thread | Next thread >>  
Linked tabled with db_Select          
Author Post
Virtuoso
Sun Sep 26 2004, 12:34PM
Registered Member #15461
Joined: Thu Sep 09 2004, 01:56PM
Location:
Posts: 2
Hi.

I posted this on the e107.org site as well, I think it might be better to post it here, but I am not allowed to delete my other post at e107.org, so I hope you will excuse the double posting.

Anyway, I am trying to setup a query with the db_Select funktion in e107 and am wondering if it is possible to setup a query with linked tables seeing that the db_Select is not using the same format as the standard SQL queries I am used to?!

Thank you so much for any help!

V
bazzer
Mon Sep 27 2004, 09:16AM

Registered Member #330
Joined: Wed Jun 11 2003, 08:04AM
Location: Liverpool
Posts: 491
If you are linking/joining tables you can use the db_Select_gen($arg)

where $arg contains the select statement you wish to use. You do need to put the table name in full for example use something like <div class='indent'> $arg = "select * from ".MPREFIX."user left join ".MPREFIX."user_classes on ......";
$thingy->db_Select_gen($arg);
</div>


The MPREFIX defined constant contains the table prefix set during installation. With Select_gen you can pass any sql to the database, including update, insert and delete.

db_Fetch() etc will work as expected after using Select_Gen.

hth

Barry


<span class='smallblacktext'>[ Edited Mon Sep 27 2004, 09:20AM ]</span>
Back to top
Website
bazzer
Mon Sep 27 2004, 09:18AM

Registered Member #330
Joined: Wed Jun 11 2003, 08:04AM
Location: Liverpool
Posts: 491
Oops code /code bbcodes didn't work but I think you get the ides
Back to top
Website
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
Render time: 3.4396 sec, 0.1949 of that for queries. DB queries: 31.