This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-04 12:37:59

freakshow1
New Scratcher
Registered: 2011-04-04
Posts: 2

Get Function!

Hi!
I am making a Forum from scratch as a project for school and im stuck on how to use the Get function.
I want to have the get function  to do as follows:

1. want to be able to click on a categorie that been selected from a database that i got.
2. When i click on the categorie i want a new side to come up but it is still the same side if u know what i meen.(Not good at english so hard to explain)
3. then in the new side that im inside the categorie i want to make topics and also click on the topics so i can do a post or something just like a normal forum...

thnx ahead!  smile
//FreaKShoW

Offline

 

#2 2011-04-04 12:47:38

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Get Function!

You mean like the Scratch Forums?

If you're using PHP the 'get' function is $_GET['variable'].
Also, if you only want to update a certain section of a page then I recommend using frames or AJAX.

If you want to get data from a database the you use this:

Code:

mysql_connect('host','username','password');
mysql_select_db('database_name');
$result = mysql_query('query');
while($data = mysql_fetch_array($result)){
  //$data contains one row at a time
}

/* No comment */

Offline

 

#3 2011-04-04 16:38:01

freakshow1
New Scratcher
Registered: 2011-04-04
Posts: 2

Re: Get Function!

i know how to get data from a database but how to make the data from the base to a link and when i press it it becomes a new side .. whole new side but still the new side so it gonna say for example: www.mynewside.com/forum and when i click www.mynewside.com/forum?x=2

Offline

 

Board footer