The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Querying and such.
I know there's a way to do this, but I'm not sure what....
I want to select information from a table in mySQL, only 2 fields in the table, `name`, and `data`, and I want it to repeat a piece of code until there's none left.... Hard to express my idea... [poorexamplephp] global $count (Insert code looping until it's read all of table `query`) $name = (insert way to call the current row's `name`field) $dat = insert way to call the current row's `data`field) echo $name; echo "="; echo $dat; $count ++ (insert end of loop stuff) [/poorexamplephp] A || || That... What should be `insert` 'ed? Also, how would I query 2 out of 3 fields, or only 1? |
#2
|
||||
|
||||
PHP Code:
- miSt |
#3
|
||||
|
||||
Just one question.... where on earth did $getbattles come from? .... ? :confused"
|
#4
|
||||
|
||||
$getbattles should actually be $getstuff
|
#5
|
||||
|
||||
It is probably something he was thinking about at the time
And yes - '$getbattles' = '$getstuff' Satan |
#6
|
||||
|
||||
Okay, using that code, I've modified it to run through a table, called "tacemon" until there's nothing left, and each time, execute a bit of code:
PHP Code:
This probably has to do with global/local variables, but I tired declaring $mypkmndat as global (Which I assume is the problem, since it's the variable that I want to use outside of the loop) but that didn't help. Anyway, anyone know what I've done wrong? EDIT: *sigh* after all that typing describing my problem, I found the answer going over my post. $catchname should've been $th_rong_name. I changed it, an' it works. :dead: :nervous: :cry: Now the real test will be how it handles me adding a new row... |
#7
|
||||
|
||||
Anyway, another question. I get this error:
Warning: Cannot use a scalar value as an array in /home/pgsforum/public_html/catch.php on line 55 Warning: Cannot use a scalar value as an array in /home/pgsforum/public_html/catch.php on line 56 Warning: Cannot use a scalar value as an array in /home/pgsforum/public_html/catch.php on line 99 Warning: Cannot use a scalar value as an array in /home/pgsforum/public_html/catch.php on line 115 on every vbhome(lite) page. What would I look for to fix it? Is it something like trying to do $var ="0"; $arrary[$var] = $arryvar? (Quoted variable value used as thingy in an array?) Plz help. Also, the # of new threads, posts, articles, and messages aren't showing up.... |
#8
|
||||
|
||||
It is possible you globalised a variable used by vBhome(lite)...
Satan |
#9
|
||||
|
||||
I didn't add any global thingies, though...
|
#10
|
||||
|
||||
gengar - oopsiee at the copy and paste job and edit job from my battle script hehe
That's basically the jist of it though - mISt |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|