RSSAll Entries Tagged With: "mysql"

Displaying Mysql Tables in PHP

Once you have a Mysql database setup with a table and some data in that table you are ready to display the data through PHP. This is very easy to do not only efficiently but also with a clean design in mind. So let’s say this is your MySQL table: Categories Id, Title, Description, Timestamp [...]

Javascript & PHP Star Rating Script

Javascript & PHP Star Rating Script

I’ve searched around the interwebs for an ajax star rater and I came across a few different possibilities, all of which looked very good. The top result from google was Nick Stakenburg’s “Starbox” for “ajax star rater”. I also found Masuga Web Design’s Ajax Star Rater and a script from MySandbox to be popular results. [...]

Check if Field Exists in Mysql Table

Sometimes it is useful to know if a field exists in a mysql table before running a query using that field name, especially when the field name is coming from some kind of user input. So to do this we use the function mysql_list_fields to grab the fields out of a table and run through [...]

PHP Pagination with Mysql

So you have a Mysql table you want to pull data from, but you don’t want to flood the page with everything in the table right! So you need some pagination to seperate all the content in the table into easy to open pages. So let’s say this is your mysql query: $sql = mysql_query(“SELECT [...]

Mysql Rows in HTML Option Tag

Let’s say you want to have a simple HTML <select> form as a drop down for rows in a Mysql table. This could be for things like categories, pages, games, anything you want to have in a drop down to navigate to another page or submit a form. What ever the case is, I’m going [...]

PHP Search a Mysql Database

Nearly every website has some kind of search feature that allows you to quickly find the specific things you are looking for. This can be done a number of ways depending on the language and desired features, but I am going to show you how to search a Mysql database using PHP and a simple [...]

PHP Users Online with Mysql

Using PHP and Mysql you can keep track of the users online your website and display it on your page. First thing ,we need a table in our Mysql database for the users online. So let’s make a table in our database. mysql_query(“CREATE TABLE online( id INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), ip_address VARCHAR(25) NOT [...]

PHP Display Mysql Rows with Column Limit

This little script is very useful for having a set width of a table and displaying several rows organized in that table. It is easy to just display a table full of rows for all the data in a mysql table. Something like this: <?php $sql = mysql_query("SELECT * FROM table1"); if(mysql_num_rows($sql) > 0){ echo [...]

Mysql Rows from a Table

If you have a mysql database you can connect to, you can create tables, rows, columns, and do many other mysql functions through PHP. Let’s say we have a mysql database named “my_database”. We will connect to it using the php function “mysql_connect()” and draw information from the tables. Config.php: <?php // Config.php $username = [...]

Mysql Database Connect

To connect to a Mysql database you need a few things first. Of course you need to have the database created with a name you make up as well as the username and password of the mysql account that can connect to that database. This is very simple if you are using web managing software [...]

The tutorials and scripts found on bgallz.org are for training purposes only, use to your discretion.