PHP back button
Looking for a previous page or back button this is how it is done.
@$back = htmlspecialchars($_SERVER['HTTP_REFERER']); echo "Previous Page"; …Read More
Looking for a previous page or back button this is how it is done.
@$back = htmlspecialchars($_SERVER['HTTP_REFERER']); echo "Previous Page"; …Read More
So you are looking for the last entry in a table for your database that has auto increment. Well I have this to share with you. Use the mysql_insert_id() function.
1 2 |
mysql_query("INSERT INTO table1 (product) values ('$somethin')"); $lastID = mysql_insert_id(); |
You need to combine the insert command and then use the mysql_insert_id function to create a variable that holds the …
Read MoreAre your trying to print_r or echo the results of a mysql query to your database and just get resource #10 or resource #5 or something similar. I found this somewhere that may explain the problem.
Read MoreWhen you use mysql_query(), it really returns a reference to a result resource, which is parsed by mysql_fetch_* functions. If you directly echo out the resource, PHP just gives you the resource number. You
…
If you are trying to submit information from a database using a link here is a method I used in a project recently. This may or may not be the answer to your needs but give it a go. Just so you know it is manipulating the url like using the $_GET global.
1 2 3 4 5 6 7 8 |
<?php $query = "SELECT id, name FROM folder WHERE |
First thing to do is to create a new php page. Call it db.php and save it this will be the way you connect to the database through this file so that you only need to write this code once.
Paste this code into your new file and save it. You will have to change the username and password as well as the yourdatabaseName. See below for details.
<?php//connect
Lets suppose we have a database called Prints with several tables. The two tables we want to join are called ‘prints’ and ‘artists’. When we join the two we will create a new table which we will call ‘printdetails’.
The PRINTS table looks like this:
the ARTISTS table looks like this:
We want to join both tables into one by using a combination of columns from each table.
From …
Read MoreCalling phpinfo is useful to give you a lot of information about your php server setup. It is very simple to do as well.
On your desktop, open a new text file with notepad or similar.
Copy and paste this:
<?php phpinfo(); ?>
Save the file as phpinfo.php (or anything else as long as the extention is .php).
Upload the file to your site at the root level and then call …
Read More