![]() |
MySQL/PHP Variable Question
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 Thanks. |
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 |
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? :p EDIT: Or change DESC LIMIT to 4 or above to include extra Itemshops? |
OK, this is me testing your method.
PHP Code:
PHP Code:
|
do this for all of them
PHP Code:
|
Hmmm... Well Here's my full file:
PHP Code:
|
Anyone? This is really bugging me and I need answers fast. ;) Gotta finish this by the date... :(
|
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?
|
It's be like:
Code:
<tr> |
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:
|
Thanks man you rule! :)
|
All times are GMT. The time now is 01:01 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|