The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
OK, I'm making my own Itemshop. But I'm not the best coder around and need some help with something simple.
I need multiple things to show up from the same MySQL table column. For example, here's a part of my file: Code:
// select information
$shop_id = $DB_site->query("SELECT shop_id FROM itemshops");
$shop_name = $DB_site->query("SELECT shop_name FROM itemshops");
$shop_image = $DB_site->query("SELECT shop_image FROM itemshops");
$shop_rating = $DB_site->query("SELECT shop_rating FROM itemshops");
$shop_profit = $DB_site->query("SELECT shop_profit FROM itemshops");
$shop_total = $DB_site->query("SELECT shop_total FROM itemshops");
Thanks. |
|
#2
|
||||
|
||||
|
here try this
PHP Code:
$shop_id1 will be the first shops id and $shop_total2 will be the second shops total im pretty sure this should work |
|
#3
|
||||
|
||||
|
So then for the other Itemshops I'd just simply repeat that except change the value of $i to 2?
Or am I getting this wrong? ![]() EDIT: Or change DESC LIMIT to 4 or above to include extra Itemshops? |
|
#4
|
||||
|
||||
|
OK, this is me testing your method.
PHP Code:
PHP Code:
![]() Any ideas? Gurus?
|
|
#5
|
||||
|
||||
|
do this for all of them
PHP Code:
|
|
#6
|
||||
|
||||
|
Hmmm... Well Here's my full file:
PHP Code:
|
|
#7
|
||||
|
||||
|
Anyone? This is really bugging me and I need answers fast.
Gotta finish this by the date...
|
|
#8
|
||||
|
||||
|
you can't echo $shop_id[$i], it has to be $shop_id[0] or [1] etc, but are you going to use these variables in repeating rows or at all different parts of the page? like are you going to use $shop_id[0] at one part and $shop_id[1] in some completely different part?
|
|
#9
|
||||
|
||||
|
It's be like:
Code:
<tr> <td> $shop_id[0] </td> </tr> <tr> <td> $shop_id[1] </td> </tr> |
|
#10
|
||||
|
||||
|
because if your going to do this in repeating rows there is a much easier way, this way lets you use these variables anywhere you want, if you want to do repeating rows, ex:
$shopid1, $shopname1 etc $shopid2, $shopname2 etc then do PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|