473,387 Members | 1,481 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,387 software developers and data experts.

php update command problem discussion

I want to update attendence column by inserting intime and outtime at the table below is the coding and I want to show the result on the browser and also should be updated in table

$result = mysql_query("SHOW COLUMNS FROM mark_attendence");
while ($row = mysql_fetch_assoc($result)) {
mysql_query("UPDATE mark_attendence SET ".$row['InTime']." = '' WHERE ".$row['field']." = 'currentvalue'")
Aug 27 '14 #1
2 1378
Dormilich
8,658 Expert Mod 8TB
why do you have that SHOW COLUMNS query there? if you want to update a field—and you know its name—why not using that name directly?

besides that, there ain’t a key 'InTime' in the SHOW COLUMNS result. consult the MySQL manual to know what it really does.
Aug 28 '14 #2
Thank you share posts. posts very useful!
Aug 28 '14 #3

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

Similar topics

0
by: NETDeveloper | last post by:
Hi, I almost have my nested datagrid working properly. I created a datagrid on a user control and dropped that onto another datagrid. At first, I noticed when I was stepping through the code,...
0
by: fatmosh | last post by:
I have a GridView that is pulling data from a SQL database using a Select command. I would like to use GridView's built-in "Edit, Update, Cancel" functionality because it is very handy. However,...
9
by: Geraldine Hobley | last post by:
Hello I'm getting the above mentioned error in my applicatio I have a datagrid bound to a datasource like s MyDatagrid.DataSource = Mydataset.Tables(Order) - this all works fine However I...
1
by: Neo | last post by:
I konw that one can make use of the default UpdateCommand in the DataAdapter to save changes back into the underlying data source. But i was wondering how one could build a custom update command &...
4
by: William LaMartin | last post by:
In the past, I have filled a datagrid with data from an Access database table using a data adapter and dataset, where I used the OleDbCommandBuilder to have the program create the insert, delete...
2
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource...
8
by: 4.spam | last post by:
Hello. WinXP, db2 v8.2.7 When I use UPDATE COMMAND OPTION USING <any_switchON(or OFF) it seems that this command has absolutely no effect on these switches since command LIST COMMAND...
1
by: Selvakumar | last post by:
hai friends, I am new to .net programming. I did the inserting data into MS-access database but i couldn't able to perform the update command. I used only textbox and command button for inserting...
3
by: Brad Baker | last post by:
I have a formview with a datasource that contains a select and update command. The select statement works fine but the update command doesn't seem to be working. After some troubleshooting I have...
0
by: JDS | last post by:
I have a table with the primary key as a uniqueidentifier / GUID and the rowguid property set (it is used for replication). When creating a data table in a dataset in VS2005 the table adapter...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.