473,324 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Update row in mysql

32
Hi,

Iam trying to update row in table.its not working.iam write this code.what is wrong in it.




[PHP]<?PHP session_start();
if (isset($_SESSION['loggedin']))
{
if($_SESSION['username'] == "admin" || $_SESSION['username'] == "noise")
{
$user = $_GET["userid"];
$file = $_GET["fileid"];
include('db.php');
$sql="update upload_files SET process = 'Done' where userid='$user' and fileid='$file'";
$result=mysql_query($sql) or die('Error: query failed');
header("location:uploads.php");
}
}
?>[/PHP]


thanks
apking
Nov 14 '08 #1
1 1794
r035198x
13,262 8TB
Do you get any error messages?
Does the code inside the if statement get executed at all?
Nov 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
0
by: Peter Fleck | last post by:
I'm having some trouble updating a mysql database with a perl cgi. Here's the perl: $sql = "UPDATE grants SET agency2 = \"$agency2\" WHERE agency2 = \"$key\""; $rv = do($sql) or die "Can't...
5
by: red85 | last post by:
hello i have mysql 4.1 with win2000 SP3, i know that it is only an alpha and i don't know if someone else has already posted this problem: when i execute this sql UPDATE tableX SET...
0
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
0
by: Steven Hilton | last post by:
I am experiencing odd behavior, and I'm hoping someone can explain why it is behaving this way, and how to get around it... When I update a row in a table with a field's data set to NULL, but...
5
by: jayson_13 | last post by:
Hi, I need to implement a counter and i face problem of locking so hope that u guys can help me. I try to do test like this : 1st connection SELECT * FROM nextkey WHERE tblname = 'PLCN'...
2
by: Carlos Eduardo Peralta | last post by:
Hello: Can i update a MySQL database with just copy the files MYI MYD and FRM in the right dir? I know this work. The question is how MySQL manage the user that are usig that database in that...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
7
by: sime | last post by:
Hi, I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or...
0
by: silversubey | last post by:
I am trying to convert mssql triggers to mysql. I am very new to Mysql and would like some help with my code. My queries work but there has to be a more efficient way to write them. I would greatly...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.