SELECT FROM database
Ok, next step is to get information FROM a database, and let it display on your webpage.
__________________________________________________ We are still using the same table as in the previous artikel (tabel) I will give you the code, and then explain it all to you. PHP Code:
The part above, the connection to the database, has been explained in the previous aricle PHP Code:
Very easy IMO :) Now let's go to the next step!! Show the results on a webpage. PHP Code:
I assume you don't really know what is going on, so i'll explain the part to you PHP Code:
naam, email, titel, info And like you see, it will display all info, the layout of this is quite simple, but you can edit it all the way you want (per example add it into a table) When you've openen an echo code, don't use double quote in the double quotes, but use singel quotes instead. To go one more step deeper into mySQL i want to explain the WHERE function in a mySQL query: PHP Code:
WHERE naam='flup' Or: Selected everything in the table 'table' where 'naam' is equal to flup You also could replace: naam='flup' to email='your@email.com' or titel='administrator' Good luck!! |
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=52456" target="_blank">Click here for the tutorial: Instert into database</a>
|
Wow you use fetch_object - i never use classes,methods or objects apart from the built in $db_site object in vbulletin :)
- miSt |
Hmmmz, getch_object works good very good IMO.
But this tutorials is more for the noobs wich are going to test this outside vB ;) |
It would be nice to see a tutorial on how to do SELECTS, INSERTS, UPDATES, and DELETES using the native vbulletin $db_site methods and functions. I'd like to write a custom module for vba CMPS too but I'm not sure where to start or how to go about it. :confused:
Thanks, Jim |
Basically just use:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Quote:
Did you really call your table "tabel"? |
lol,
did you really need to quote everything to say that? |
Quote:
Any and all help on this will be deeply appreciated, :banana: Thanks again! :) Jim |
just been messing around to...
where is the forum info stored in the db and what external code would i have to use to get them? ie. $forum['threadcount'] $forum['replycount'] $vbulletin->userstats['numbermembers'] Regards, Nick. |
Say we use this query for an example:
PHP Code:
PHP Code:
|
Quote:
I do not know how to use it, please help me. Thank you very much :) (Normal PHP is: ex: $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo {$row['threadid']}". "{$row['title']}". "<br/>"; } |
All times are GMT. The time now is 03:52 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|