I want to learn a lot! Can anyone help me?
• JavaScript
• C
• Squeak! (jd1s gonna teach me this)
• Using MySql in PHP
• and other stuff i can't think about
So can you help me?
Offline
My dad uses programming languages a lot (probably because he's a programmer
) but I've never tried any of them.
Offline
bump!
Offline
werdna123 wrote:
My dad uses programming languages a lot (probably because he's a programmer
) but I've never tried any of them.
Is that how you got into Scratch?
Offline
I know about as much JavaScript as you do, you know that
Offline
C, C+, and C++ I would like to learn. Oh, and Starlogo TNG.

Offline
Aidan wrote:
werdna123 wrote:
My dad uses programming languages a lot (probably because he's a programmer
) but I've never tried any of them.
Is that how you got into Scratch?
Nah, a friend told me.
Offline
So does anyone want to teach me any? I'd like to learn JavaScript first
Offline
ProgrammingFreak wrote:
So does anyone want to teach me any? I'd like to learn JavaScript first
w3 would like to teach you.
Offline
Sunrise-Moon wrote:
ProgrammingFreak wrote:
So does anyone want to teach me any? I'd like to learn JavaScript first
w3 would like to teach you.
lol
Offline
ProgrammingFreak wrote:
• Using MySql in PHP
Important warning: I know a very old version of PHP and there are probably much easier ways of doing the following. Feel free to research different methods to the one I am showing you.
First, get a database and find out the connection information. This is easy with 000webhost.
To connect to the database using PHP, use this:
mysql_connect($mysql_host,$mysql_user,$mysql_password);
Then you need to tell the MySQL server which database you want to use. To do this, use this code:
mysql_select_db($mysql_database);
You're now connected, but you need to know how to send and recieve data. To do this, you need to learn SQL. W3 can teach you.
Now we need to send stuff to MySQL. If you just want to send data, but not receive any, it's simple. Just do this:
mysql_query($query);
If you want to send and receive data, then that's slightly harder. First, you send the query and MySQL will send back a pointer to where the information is in the database:
$queryResult = mysql_query($query);
Important to rememeber: $queryResult does not yet contain the data.
The data is returned one row at a time. To check how many rows of data have been found, use this:
mysql_num_rows($queryResult);
Now to actually get the data. When you ask MySQL for the actual data, it returns an array with a key for each row. The array looks a bit like this:
someArray[0] = "value1"
someArray[1] = "value2"
someArray[2] = "value3"
someArray["firstColumnName"] = "value1"
someArray["secondColumnName"] = "value2"
someArray["thirdColumnName"] = "value3"
You'll notice that each piece of data is accessible under either $someArray[number] or $someArray[columnName].
If you are only hoping to get one row of data, the next bit is easy:
$result = mysql_fetch_array($queryResult);
$result now contains an array like the one above. If you want to only have the numbers as keys or the column names as keys, add the argument MYSQL_NUM or MYSQL_ASSOC to the fetching code. Example:
$result = mysql_fetch_array($queryResult,MYSQL_ASSOC);
Important to remember: Do not put a $ sign before MYSQL_*.
If you want to fetch more than one row of data, then it is more complicated. Since only one row is returned at a time, you need to use a loop. An easy(ish) way to do this is this:
while($result = mysql_fetch_array($queryResult,MYSQL_NUM){
//Do something with $result here,
//but remember it only contains one row at a time
}That's the basics, but there's lots more to it. Research it at your will.
Offline
TheSuccessor wrote:
ProgrammingFreak wrote:
• Using MySql in PHP
Important warning: I know a very old version of PHP and there are probably much easier ways of doing the following. Feel free to research different methods to the one I am showing you.
First, get a database and find out the connection information. This is easy with 000webhost.
To connect to the database using PHP, use this:Code:
mysql_connect($mysql_host,$mysql_user,$mysql_password);Then you need to tell the MySQL server which database you want to use. To do this, use this code:
Code:
mysql_select_db($mysql_database);You're now connected, but you need to know how to send and recieve data. To do this, you need to learn SQL. W3 can teach you.
Now we need to send stuff to MySQL. If you just want to send data, but not receive any, it's simple. Just do this:Code:
mysql_query($query);If you want to send and receive data, then that's slightly harder. First, you send the query and MySQL will send back a pointer to where the information is in the database:
Code:
$queryResult = mysql_query($query);Important to rememeber: $queryResult does not yet contain the data.
The data is returned one row at a time. To check how many rows of data have been found, use this:Code:
mysql_num_rows($queryResult);Now to actually get the data. When you ask MySQL for the actual data, it returns an array with a key for each row. The array looks a bit like this:
someArray[0] = "value1"
someArray[1] = "value2"
someArray[2] = "value3"
someArray["firstColumnName"] = "value1"
someArray["secondColumnName"] = "value2"
someArray["thirdColumnName"] = "value3"You'll notice that each piece of data is accessible under either $someArray[number] or $someArray[columnName].
If you are only hoping to get one row of data, the next bit is easy:Code:
$result = mysql_fetch_array($queryResult);$result now contains an array like the one above. If you want to only have the numbers as keys or the column names as keys, add the argument MYSQL_NUM or MYSQL_ASSOC to the fetching code. Example:
Code:
$result = mysql_fetch_array($queryResult,MYSQL_ASSOC);Important to remember: Do not put a $ sign before MYSQL_*.
If you want to fetch more than one row of data, then it is more complicated. Since only one row is returned at a time, you need to use a loop. An easy(ish) way to do this is this:Code:
while($result = mysql_fetch_array($queryResult,MYSQL_NUM){ //Do something with $result here, //but remember it only contains one row at a time }That's the basics, but there's lots more to it. Research it at your will.
THanks! I like it.
Offline
I got my first start in programming with Batch files. Then I learned VBScript. Then I learned to write a program with three simple lines of code that can crash your computer...
I've learned a lot of malicious programs you can write. I don't ever write them, but I know how to. Then, I learned to make screamer programs...
Other than that, I recommend that you learn Perl.

Offline
ProgrammingFreak wrote:
I want to learn a lot! Can anyone help me?
• Using MySql in PHP
I'd actually like to learn some more of that myself. That's pretty much what the Scratch website (and these forums) run on.
Offline
I know php & mysql. I first learnt some of it from school. Then at home I built a web server that runs a database. It was quite fun.
This is what I built.
A website which you sign up to to go to members only area's
When you sign up you get sent an email (A record is made in the database for the account)
When the account is confirmed the account is activated
You can then log in to the account (get sent a cookie/ session) and access member only area's.
I also know how to set up web stores so you can sell stuff on your website (Through paypal) as well as only allowing members to purchase goods and services.
Edit: I could make forums but that would require a lot a tinkering with the design and would take ages to program all of the features (e.g. word length, allowed words, types of members, signitures, BBCode( With BBCode I could call it something else and use any symbol I want) )
Last edited by what-the (2010-12-21 22:12:35)
My site Offline
I should read my Javascript book that I got for my class next semester. Maybe then I can learn more than what i already know. Which isn't much.
I know mostly onclick events. They can be fun to play around with.
[offtopic]Why did W3 ever depricate the HTML tag Marquee!? It works wonders for some of my personal sites. I understand why they did it, but it was useful.[/offtopic]
I would suggest looking at W3's website. Any web/server "language" you want to know, they have tutorials on.
Offline