Adding Delete Option
Have a look at this code found at Zend:
http://www.zend.com/php/beginners/php101-8.php#Heading5
I've been trying to figure out how I can add a "delete" option next to every row result that comes from the quiery. There's a mini tutorial a little further down on that page but I would specifically like it for this structure of code. Also the mini tutorial is in mysqli instead of mysql.
View Complete Forum Thread with Replies
Related Forum Messages:
Delete Option From My View Records Page
I have a list of things I need to do with my database - but this is my next hurdle - the delete query within my view records page. I want to be able to click on a button or link to delete a record in a table. I was envisaging that each record would have a delete button or link next to it and clicking that would remove it. Here is the script I have created to view "Devices": PHP Code:
View Replies !
Listing Table Data With An Option To Delete Each Individual Item.
Was wondering if anyone could help me with a PHP, MySQL problem. I am completely new to PHP and MySQL. I have been trying to find a way to list data from a table on a web page and after each individual item have a hyperlink to allow users to delete the information listed. Can anyone help? i.e. Name Age Sex ------------------------------------------ Adam 21 M delete Betty 22 F delete Chris 23 M delete Daisy 24 F delete ------------------------------------------------------------------------------------------------------------------------------ (delete after 'Sex' would be the hyperlink to delete that entire line (row) from the table).
View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:
View Replies !
Select <option> </option>
I have this script in a form, it is trying to send a selection from the from to the next page. But the proble is that if the selection has a space in it, it only sends the first work to the next page. Code:
View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong? <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $id="delete from todo where id='$id'"; mysql_query($id); mysql_close(); ?>
View Replies !
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ? $query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); im just getting "Unknown table 'notes' in MULTI DELETE" ?
View Replies !
<option> &
I have an array like the one below PHP Code: array( 1 => 'Apparal', 'Business', 'Game', ); How can i get PHP to echo out an <option> tag for each value in that array. I want the key to be the value of the option, and the value to be what the option is. <option value="key">Value</option>
View Replies !
<option>
If I know the text of an option (or the value) how can I get the option position/number? For example: <select name="numfontype"> <option value="AARVC___.TTF">Aardvark Cafe</option> <option value="Abduction.ttf">Abduction</option> <option value="Adventure.ttf">Adventure</option> <option value="air_mitalic.ttf">Air Millhouse</option> </select>
View Replies !
Option Value
I'm tring to concat 2 columns from mysql. Lot and Unit. I have tried everything to get my code below to work. <? $mysql= "select concat(lot,''-'',unit) as t from production where community= '$community' "; $query = mysql_query($mysql); echo "LotUnit "; echo "<select name="t" size="1"> "; while ($row=mysql_fetch_array($query)) { echo "<option value="".mysql_result($query,$i,"t").""></option> "; } echo "</select> "; ?>
View Replies !
Add Option Modifiers
I am working on trying to create an admin for a product catalog, the only problem i am having involves product modifiers such as the ability to add size and color to the product that can also increase the cost of the product. I was wondering if anyone would know a really good way of going around to do this, the only way I can think of is having a product option table that would hold the value of the modifier plus the cost plus the product id that this references too plus its own special id.
View Replies !
PHP GTK Option Questions
Before I invest more time in researching and testing I am curious if anyone knows for certain if a PHP_GTK application running on a Windows machine can communicate and interface with a remote database SECURELY? My plan involves creating a support system which would be a standalone application on a Windows Workstation. This application would query data from a remote database SECURLY and then support personal would be able to modify, edit, etc. data from the PHP_GTK application which would in turn update data in the remote database, again securely. Can a PHP_GTK application support this, security being the biggest concern?
View Replies !
Readdir & Option Value
more or less that is my problem: i'm making HTML <select><option> statement: if ($dir = @opendir("/the/directory)) { while($file = readdir($dir)) { echo '<option value="'.$file.'">'.$file; } } the number of options depends of number of files in directory. When user chooses one of this files(he chooses an option) i want to know what option he choosen.
View Replies !
Option Button ?
I want to create a form with 3 groups of 2 options buttons (radio buttons in Dreamweaver). Can someone helps me in sending links to PHP Reference ? Example: a > 0 Option(Yes) Option(No) b > 0 Option(Yes) Option(No) c > 0 Option(Yes) Option(No) Submit Button Action of the submit button: If option_a_yes is checked (...) then open html.
View Replies !
Option Values
From my experimentation there seems to be a difference when using values from an option value as apposed to an value by a check box etc. I can quite easily input data from a check box selection, but not an option value. Code:
View Replies !
Pagination Option
Below (A) is a portion of my pagination code where I specify the limit. What I'd like to do is add a select function (B) that will allow users to specify the limit. On change of select option, it should refresh with the new limit: Code:
View Replies !
Option Selection
I am making a Option Box (Drop down bar) for Gender, (Male,Female) and I want when they Select there Gener, and then hit submit, it Writes to to a Database. i have it set it up so far that it goes to another page to INSERT it into the Databse.
View Replies !
<select> Option
I know PHP is a server-side language, so it's not client-sided. What I want to do is have a <select> dropdown with options and I want the page to refresh itself and display some information on that option. The problem is that since PHP isn't client-sided, I don't know how to get the value of the selected option and display the relevant info on that option. Any ideas on how to do this with PHP?
View Replies !
Option Value Remember
When a user clicks on a car the option box selects what car has been choosed, after filling the form in and if he has forgotten to type some info, the script echos what did he forget, and the prob is, that the option value disappears. How can i save the value or post it over? Code:
View Replies !
Put Attachments Option
how can i put a attachments option on my phpnuke forum i want people to be able to use attachments Mp3,wav.zip.pic.rar,and more. what im doing a forum so people can battle Beats on the forum by puting attachments and people can download the beat or if it is posible to be no download youst click.
View Replies !
Cannot Do A Fopen With A 'w' Option In PHP
Using Mac OSX, I am trying to write a file to my local disk (create one also) and It keeps failing. I open and read an existing file, but cannot create or write. Does it have something to do with 'safe mode'? I have tried turning it off with ini-set(safe_mode,"off") with no luck and no result either. Have been programming for 25 years, but only a couple weeks in PHP and I'm stumped.
View Replies !
Select Option
I want to load textarea's value in drop-down box. In first page, such form is existed. <form name="form1" method="post" action="next.php"> <textarea name="dayList" Id = "dayList" cols=20 rows=10></textarea> </form> in text area there's one column of values. in "next.php", put values of 'dayList' in select option. I made a code by myself. However, as you see, it's just nonsense. How can I modify this? Code:
View Replies !
Add Formatting Option
I've developed this simple piece of script for my client so she can easy add news to her homepage from the admin Panel, I would like some advice on how i would go about adding some formatting options to the content in the textfield be, like bold, italic and linking tags etc. <html><head><title>Add News</title></head> . PHP Code: <body> <form action="" method="get"> <textarea name="newscontent"></textarea> <br><br> <input type="submit" name="Submit" value="Add"></form> </body> </html> <?php $Submit = $_GET['Submit']; if(isset( $Submit )) { .............
View Replies !
Option In Form
I have this HTML code HTML Code: <form method="POST" action="action.php"> <input type="submit" value="Address" name="B2" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; border: 1px solid #000000; background-color: #000000"> <input type="submit" value="Phone" name="B2" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; border: 1px solid #000000; background-color: #000000"> </form> in action.php i want a code to run depending on which optoin was clicked ie: B! or B2, how can this be done?
View Replies !
Go Back Option
I need a code in php to go to the back page and display the contents which were their. I've only a table in the back page which contains the data derived from database. I've the present code as: <input type="reset" value="Go Back" onclick="resetstr()"> and at the top of the page i've added before <html> the below script. I know its not working.Plz help. <script language="javascript"> function resetstr() { parent.main.location.href="streaminfo.php" } </script>
View Replies !
With Select Option
i am developing simple site for php where i put onle selct box,I have to check the value from the select box and put it in the database.I am having problem that if a value is alrady selectd , if you want to select it agin i have to prompt up the message that value is already selected.
View Replies !
Using A Variable In The <option> Tag
I have a variavle called $quart_code as well as $quart_nom. These two variables are called from a database. Now I use a form to display the values for those two variables for a specific entity in the database. I do this as follows: <?php ............ echo "<option value="".$quart_code."">".$quart_nom."</option>"; ............ ?> I am using this same form to update the values of those two variables in the database table. The problem is that the quart_code field in the database gets updated with the value of the quart_nom field in the option tag. This is what I don't get especially since I set the value of the option tag to $quart_code.
View Replies !
Building Option Box
I need help building a an option box. Basically, the admin will select a user from one table and upload files to another table. When that user logs in, they should be able to see those files that are associated with their name. However, I do not know the best way to do it. I would post my code, but I think I am going about the wrong way. This is how my table structures are laid out table_cust field: cust_id field: password table_upload: field:id fields: (file info) field: cust_id
View Replies !
Right Option In Select Box
I've a small problem but I can't fix it. When I want to edit an article I click on the article and you get redirect to a new page where you can change te values (title, category, author, etc). The categories are in a select box and I want to, when you edit an article, that the right category from that article is selected. <select name="category" class="category"> <?php $allCategories = getAllCategories(); foreach ($allCategories as $category) {?> <option value="<?=$category['CATEGORY'];?>"><?=$category['CATEGORY'];?></option> <?}?> </select> This is the MySQL below (a part of it) when I edit a page. else ...............
View Replies !
Option Dropdown
Im trying to create a "Select all" search Option dropdown form , but the options are stored the the database. Heres my original form: <option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option> Basicly it has 20 or so options, but no "search all" option. I had a play and came up with this but its adding the "select all" option every 2nd field: <option value="<? echo $rst["id=all"]; ?>">All Categories</option> <option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option>
View Replies !
Empty Option
I use the following script to populate a drop down menu category menu in a form on my site: <select name="relCatID"> <? $result_cat = mysql_query ("SELECT title, catID FROM $table ORDER BY title ASC"); if ($row_cat = mysql_fetch_array($result_cat)) { do { $catID=$row_cat["catID"]; if ($catID == $relCatID){ ?> <option value="<?=$row_cat["catID"]?>" SELECTED><?=$row_cat["title"]?></option> <? } else { ?> <option value="<?=$row_cat["catID"]?>"><?=$row_cat["title"]?></option>.
View Replies !
Imap_mail_move Or Imap_mail_copy Option
To develoment. I use imap function by UW imap4 at PHP. imap_mail_move function can have option CP_UID for coping UID by PHP manual. but UID does not copy. I don't know why it is not. I hope to detect the reason. PHP 4.3.x UW IMAP4
View Replies !
Editable Option List
I fill a list of option from a mysql table $resultprod = mysql_query ("describe my_table"); while($row = mysql_fetcharray($resultprod)) { echo ('<option value="' . $row['Field'] . '">' . $row['Field'] . '</option>'); } echo "</select>"; } but I would also like the user to be able to add it´s own value if the value he/she want to enter is not in the mysql table. how can I do that?
View Replies !
Multiple Option Button
I have 2 fields username and password inside a form + 3 options (member, affiliate and admin) each one has different file (member.php, affiliate.php and admin.php) thus each option have a different post file. how can you do it in php to have 1 form with the mentioned but forwarding to the selected option file.
View Replies !
PHP And A Pre-selected Option In A Form
I've got a little text editor thing on my site, and to open a file, you input the file name and choose the folder from a drop-down list and click the Open button. The default filename is "index" and that file keeps track of all the files contained in that folder. It works okay. What's annoying is that regardless of what folder you're messing around in, the drop down list always goes back to showing the default folder name as the page is reloaded. I want it to be preselected to the folder it's in. It seems simple enough--the folder you're in is $_GET['dir']. But I've read some HTML form how-tos, and I can only see that you can preselect using the tabindex="" or selected attribute.
View Replies !
Drop Down Box With Select Option
I have a couple of drop down boxes which you select the option you want, that value is then stored in the database. If you make a mistake there is an edit option which once clicked shows the form with the information filled in/selected. However my problem is that when you edit, although the current option which was previously entered into the drop down box is set as the starting value, which is disabled, if you dont change the drop down box the value is deleted rather than held as it hasnt changed. Code:
View Replies !
Remaining Value For Select Option
i've used $_SERVER[PHP_SELF] , so my form and script are just one file . when a user click the submit and have some errors the sript reload again , for a reloaded script i've put :(for exaple) <input type="text" name="username" value=$_POST[username] /> so when it reload the last information the uer has typed won't be delete.it stays. i want to do the same with my "select menu " , i don't know how , the select menu reset when script reload :(example) gender : <select> <option value="">select one</option> <option value="m">male</option> <option value="f">female</option> </select>
View Replies !
Select/option Action?
I am trying to figure out how to click an option in a select menu and have that option act as a hyperlink/form submit without a submit button. Here is an example of what I am trying to do: Code:
View Replies !
Selecting Option In Select?
I am trying to populate a drop down list from values in an array, and compare a $_REQUEST or $_SESSION value to each of the array values. If they are equal, then the option in the drop down menu will be selected. Can't get it to work... Here is my code:
View Replies !
Setting Selected Option Using PHP
I have a drop down list which I want to be set to what was selected when the form is submitted. As the form is processed by the same page, it returns to the preset default. How would I go about making this selection box set the option selected on the next page?
View Replies !
Preselect Option In Drop Down Box?
i have a page that i use to edit a record problem being one oh the fields in the form is a selection box/ drop down box but when i load the page to edit the record i have to click on the Frame Type again. my question is: How can i get it to automaticaly SELECT the Frame Type? Code:
View Replies !
Multi Option Search
I am trying to help our IT guy at work with a custom solution for our staffers. I have the general idea down (at least I think anyway) but I need a few nudges in the right direction. This is an in house use only application for employee reference as opposed to a public use kind of thing. Code:
View Replies !
Points Option For Standings
I have a standings at my soccer site, it shows wins - ties- defeats. I want to add "points" option. This option should work like this; 3 points per win and 1 point per tie.
View Replies !
Dynamically Selecting Option
I am creating a member edit page, I have 3 select boxes on this page. 1 of the options in each select box will be stored in the database. This member page will be a dynamic page dedicated to the member the user clicks on. Hope I haven't lost you yet (I tend to do that) Now this is an example of one of the select statements. option 1 option 2 option 3 option 4 Now if option 3 is what is entered into the database I would like that to be showing when the user clicks the page. So the option in the database I would like to be the default option.
View Replies !
Add An Option Of Changing Password.
I am trying to create a simple login form: login and password. I got to a point where I want to add an option of changing password. I have an empty file password.txt. When the user types in new password I want it to be saved to a file. Code: $newpass = trim($_POST['newpass']); $fp = fopen("password.txt", "w") or die("Couldn't open $newpass for writing!"); // saving data fwrite($fp, $newpass); fclose($fp); #close the file I'm getting Warning: fopen(password.txt): failed to open stream: why?
View Replies !
Select Data Into Option Box
Say I have a form <select name="Birth_Month"> <option value="">(Month)</option> <option value="01">Jan</option> <option value="02">Feb</option> <option value="03">Mar</option> <option value="04">Apr</option> <option value="05">May</option> <option value="06">Jun</option> <option value="07">Jul</option> The user selected one field, and that field's value is stored in the mysql database. My question is, if the user wants to come back to the page, and select "Edit". .. Then he/she should get a form that his Birth_month's value has already been selected for him. I did the select * query <?php echo "value="$row[6]"";?>> The $row[6] is the row that contain that user's month info. But I don't know how can I use that row to insert into those option box?
View Replies !
Items In <option> Not Showing
i have the combo boxes, the options are retrieved from the database directly. // first combo box <select name="queryTypeCombo" onchange=submitForm()> <option>-- Please select --</option> <option value = 1>OnLoan</option> <option value = 2>Availability</option> <option value = 3>Missing</option> <option value = 4>Condemned</option> </select> i did a document.form.submit() to get the $_POST['queryTypeCombo'] and store it into a session. after the onchange() is executed in first combo box, second combo box will be displayed. the option values in the second combo box is dependable on the options selected in first combo box. Code:
View Replies !
Print Text Only Option
I would like to create a print text only option on my web site. I need to grab all the text on a current screen (whether it be dynamic PHP database text or static HTML) and print it. I want to print text only and ignore images, logos and navigation etc. can this be done using PHP?
View Replies !
<option Values> In Mysql
i have noticed nearly all other sites do this when storing option values into mysql example: <option value="1">United Kingdom</option> i usually do this: <option value="United Kingdom">United Kingdom</option> is there any advantages to doing the first one as opposed to the second? also how would i echo out the country name just going by a number?
View Replies !
Imap_body With FT_UID Option
I'm trying to fetch the body of a specific usenet message using the imap_body function with the FT_UID option (The msg_number is a UID). My understanding is that the UID is the string that looks like this: <1126793330.520771.201070@g49g2000cwa.googlegroups. com> So after I have a successful connection ($nntp), I try: $msg_body = imap_body($nntp, '<1126793330.520771.201070@g49g2000cwa.googlegroups. com>', FT_UID); And I get: Warning: imap_body(): Bad message number in ... Any idea what I am doing wrong?
View Replies !
|