473,889 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create dynamically edit table entries

34 New Member
i wish to know how to create a dinamically edit table entries .can u help me ?thanks.
Sep 29 '06
11 9304
Sheau Wei
34 New Member
Is your id field in your db row numeric or character? rEMEMBER: In the example it is a numeric, so the sql statement defined is something like "... WHERE id=. $_REQUEST['i']". When it is a character field, you must enclose this id in quotes, such as
Expand|Select|Wrap|Line Numbers
  1. $sqlst = "UPDATE listofitem SET NameOfTools='$NameOfTools' WHERE id='" . $_REQUEST['i']."'";
If the id is numeric, you must have changed the code in some other place. In that case, please show it exactly as you have tested it.

Ronald :cool:
So sorry to make u diffucult.
Now i already understand what did u mean in the above code. But it seen like not suitable with what i want to create. So now i have another idea is that create a form that can edit by user corresponding to the ID andinformation that display as the code below

if (isset($_GET['id'])) {
$id = strip_tags($_GE T['id']);
//required file for database connection
require("config .php");

$information=my sql_fetch_array ($sql);
echo "<table border='1'>";
echo "<tr><td Name</th><td >Brand</th></tr>";

echo"<tr><td>{$ information1['Name']}</td>
<td>{$informati on1['Brand']}</td>;
echo "</table>";

And then i had found an example like below

//required file for database connection
require 'config.php' ;
//user photo display

echo "<a href=user_profi le.php?ret=gene ral>General Information</a><br>";

if ($_GET['ret'] == '' && $_GET['edit'] == '' ){
echo "<font color=ultra>*Se lect the user profile on the User Profile menu above</font>";

if ($_GET['ret'] == 'general' ){

//User General Information Retriving
//find the user
$general_result = mysql_query("SE LECT * FROM system_user WHERE userId='{$_SESS ION['userid']}'")
or die(mysql_error ());
$general_row = mysql_fetch_arr ay( $general_result ); //set $row to result

//table to display general user inforamtion
echo "General Information";
echo "Staff ID: " . $general_row['userId'] ."</td></tr>";
echo "<tr><td width=20%>Staff Name</td><td width=65%>: ".$general_ row['userName'] ."</td></tr>";
echo "<tr><td width=65%><br>
<a href=user_profi le.php?edit=gen eral><img src=images/edit.jpg border=0></td></tr>";
echo "</table>"
}//end selection on general information retriving

//User general edit mode
if ($_GET['edit'] == 'general' ){

//User General Information Edit Mode
//find the user
$general_result = mysql_query("SE LECT * FROM system_user WHERE userId='{$_SESS ION['userid']}'")
or die(mysql_error ());
$general_row = mysql_fetch_arr ay( $general_result ); //set $row to result

//table to display general user inforamtion

echo "<font size=4 color=blue>Gene ral Information: </font>";
echo "<font size=4 color=Red>Edit Mode</font><br><br>";
echo "<table width=75% border=0>";

echo "<tr><td width=20%>Staff ID</td><td width=65%>: " . $general_row['userId'] ."</td></tr>";

echo "<tr><td width=20%>Staff Name</td><td width=65%>:
<input name=txt_userNa me type=text value='" . $general_row['userName'] ."'></td></tr>";
}//end selection on general information edit

if ($_GET['edit'] == 'gen_confirm' ){
echo "Are you sure to save the changes? <a href=user_profi le.php?edit=gen eral_ok> OK <a/>";
//echo $_GET['txt_userName'];
echo "Hello...";
if ($_GET['edit'] == 'general_ok' ){
$general_update = "UPDATE system_user SET WHERE userId='{$_SESS ION['userid']}'";
mysql_query($ge neral_update) or die(mysql_error ());
//$general_row = mysql_fetch_arr ay( $general_update );
echo "Are you sure to save the changes? <a href=user_profi le.php?edit=gen eral_ok> OK <a/>";

Do u think it is suitable for me to follow this format?If yes how do i do. I had try to follo tat code but it seen like didnt work because error : "unfind index edit".
Sep 30 '06 #11
4,258 Recognized Expert Specialist
I am sorry, but you have lost me again. Whatever happened to your original request of changing one row in a table? It is like aiming at a moving target. You keep changing your requirements. What you requested was:
yes.i oly want to edit one row of a table. How to make it?
i wish to know how to create a dinamically edit table entries .can u help me ?thanks
for which the sample code was presented to you.WIth some php knowledge you can change that sample and I can help you with that but don't bring in a completely different piece of code now.

Now let's get back to that requirement or stop this discussion.

Ronald :cool:
Sep 30 '06 #12

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

Similar topics

by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would then like that, when clicking the LinkButton, the user can be navigated to another page, carrying a variable. I would like to use server.transfer method instead of QueryString as I don't want the carried variable to be visible for the user.
by: nick_faye | last post by:
Hi guys, i'm still a newbie in using MS Access and in VB programming. I am using DAO connection from my VB to access the entries on my MS Access table. I am having trouble in editting and deleting entries from my table because it becomes slower and slower when my table is getting bigger and bigger. What I am doing right now is get the ID of the entry to be editted/deleted and I have to loop from first entry until I found the right ID...
by: goitz | last post by:
Im looking for a way to dynamically create a table and append a text box to it using a list of information from a database eg> display a results of a select statment then add a text box--> field1 field2 textbo datagrids only allow clicking a button to edit a field, too much clicking to edit multiple fields required Please help
by: neoteny2 | last post by:
I need MS Access to automatically create reports/subreports based on specific criteria. I am building a database in Access 2003 with different locations/sites. I have the "sites" table created containing site info, including an empty field for "date". I also have a report format already created displaying the site info. I need Access to ask the user for a date, calculate three additional dates using the entered date (adding or subtracting...
by: news reader | last post by:
Hi, Does anoone of you know if there is already a simple application doing something like this. I would enhance / tune the missing features, but would like to avoid to start from scratch or to start from something, that has far too many features and is difficult to setup.
by: dauphian | last post by:
Greetings, I have a user control, that I will need to display on a specific page based on the number of records in database: I have to query a site table to get the number of entries as well as a specific column field for each entry. I then pass that to the user control to grab a specific set of information from another table and display.
by: bharathmngl | last post by:
now iam trying to add rows dynamically into the table when i click "ADD ROW" button. It should also have the option to delete the selected row. So Please help me to find code.... And also please tell me how to add textarea and radiobutton in to the dynamically created rows.. Here is my code; <html> <head> <title>Untitled Document</title>
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio buttons and check box. I am adding two radio buttons once for a row.Now my problem is the radio buttons in all the rows that added dynamically are behaving as same group i.e when i am selecting a radio button in second row,radio button in first row...
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have set text boxes and labels inside the table rows. I then added a button. All of these are done through code. The problem that i am having is i can get the value from a text box with resides inside the first panel (out side of panel that is...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.