Fetching information from database
I find web designing and developing languages easy to learn, as long as you find that one thing that gets you really interested. For me, it was Javascript functions in Javascript, and fetching and displaying information from a database in PHP. It is pretty easy, just learn these lines of code:
< ?php $query = mysql_query("SELECT * FROM your_table WHERE a_row = 'something_specific'"); /* or just $query = mysql_query("SELECT * FROM a_table"); */ while ($row = mysql_fetch_assoc($query)){ $stringname = $row['some_table_to_get_info_from']; $and_so_on = $row['and_so_on']; /* ... */ } ?>
You can also list them, or repeat the search and get multiple results like this:
<?php $query = mysql_query("SELECT * FROM users"); while ($row = mysql_fetch_assoc($query)){ $username = $row['username']; $link_to_profile = $row['link']; ?> Username: <?php echo($username); ?> <a href="<?php echo($link_to_profile); ?>">Link to Profile</a> <br /> <br /> <?php } ?>
This will result in something like this:
Username: James <a href="http://domain.com/James">Link to Profile</a> Username: Billy <a href="http://domain.com/Billy">Link to Profile</a> Username: Christine <a href="http://domain.com/Christine">Link to Profile</a>
You see how it made a list instead? That is because we made a template for the list inside the while, and ended the while afterwards, making it repeat that template for every search result it finds for the query specified! After experimenting, you will definitely get the hang of this.












