Welcome to WebmasterWorld Guest from 18.104.22.168
$host = "host";
$user = "user";
$pass = "pass";
$dbname = "dbname";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
$query= "select * from 4images_images where image_id='" . $_POST['image'] . "'";
// $num_results = mysql_num_rows($result);
$row = mysql_fetch_array($result);
header("Location:$file"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
Is it a problem with my redirection script? Do i have to use other redirection technique to get the file? thanks in advance.
i got that message when i try to browse the page with a Sony Ericsson T610. My guess is, if redirecting doesn't work this way, is it possible to use other method to redirect the user to the file? Probably prompt the user to save the file instead (will this work on a mobile phone?) I am so stuck :(
Btw, just wondering, if updating the database entry difficult? I already learnt how to access the information from mysql, but is it possible to update the data on the database once you've retrieved information from it? thanks!
1) access the information from database
2) use update to update the row (i only need to update a row)
but then where does DELETE & INSERT comes into then? do i have to delete the row first? then insert new data, then update? opss..i think i'm confused...i only want to inc + 1 to a field. But thanks to the link to the reference. It's really comprehensive!
a little list of commonly used mysql commands
So I installed MySQL, what now?
1. Create a database using CREATE DATABASE [mysql.com]
This gives you an empty DB, now what?
So a bunch of empty table in my DB, so what?
Well, the key to a Database is, yes you guessed it, data.
3. Manipulate some data
Get new data in the table
Need to change the data in the table
Need to remove some data
Want to take a look at some data
These are all fairly standard functions though they can be very complex. Many more...
MySQL Online Manual [mysql.com]
I am a command line type but most people use phpmyadmin for these things and don't always understand right away how much is being done for them.
so from the manual,:
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name [, tbl_name ...]
SET col_name1=expr1 [, col_name2=expr2 ...]
This begins to get tougher. I wanted to change the data from 4images_image table, where Image_ID="blah blah" and change the Image_Hit= Image_Hit + 1
so i use this command:
UPDATE 4images_Images SET 4images_Hit=4Images_Hit + 1 WHERE Image_ID="Blah blah";
Am i right guys? Am i right? :)This is actually very interesting. It's kind of nice if you can get it to work. Thank you jatar, you are my man!