Delete Data From MySQL Database
I am new to PHP and MySQL but I have setup a MySQL database. I can view the information in an HTML table using PHP scripts and can delete an entry form the database table, but what i need to do is to be able to delete an entry by selecting a radio button next to the relevent information however when i try to add a form in the PHP script i get an error.
View Complete Forum Thread with Replies
Related Forum Messages:
Delete Data From Database
Let's say i have two tables, table_one; userid,userinput,indexno table_two; cond,qant,amp,indexno the indexno in table_one and table_two are the same.if i choose to delete one row of data in table_one,i want the data with the same indexno in table_two be deleted as well. how can i achieve this?
View Replies !
Delete MySQL Data
I am building a lunch ordering system for a company. The employees can login, order lunch, and the administrator can see what everyone ordered for lunch in the admin panel. The problem is that when the employees enter data, it stays in the database until they update it. If an employee is sick, their lunch order from the previous day is still in the database. Is there a way to clear those values they enter at a certain time in MySQL.
View Replies !
How To Delete MySQL Database.
I've got three hostings with the GoDaddy hosting service. The hostings are supposed to provide only one MySQL database each. I've just recently noticed in the phpMyAdmin program that separate databases, each with the name "test," has appeared in two of the three hostings. I don't know how they got there. I didn't put them there. I contacted GoDaddy's technical support. They said that the "test" databases automatically comes with the phpMyAdmin program. Of course, that's not right. Anyway they said that I could delete the extra database without damaging anything.
View Replies !
Simple Login Page To Delete And Edit Things In Mysql Database
How do I build a simple login page on my site? I need a way to login to my admin area in my webshop, so I can add, delete and edit things in mysql database. I don't need help with add, delete and change things, only the login thing. The users should not even know that there is a admin login page. The users don't login to shop, they just shop so I can't use the user login page because there is no such page. Can someone please give me some guidelines for this?
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 !
Data Not Posting To My Database Php/mysql
I am having a problem postion data from my form into my database. My users visit my site and fill out a form which is suppose to go into my mysql. I check phpMyAdmin to see if the data got there but nothing. Below is my Code. could someone help me out. Code:
View Replies !
Mailing Data From Mysql Database
I have searched, but didnt find what I need. I am trying to mail someone if a user changes data in my MySQL database, which is being written to by a php script. All is set up, just need to be notified of what data got changed.
View Replies !
Writing Data To MySQL Database Using PHP
Can anyone tell me why the following code isn't working? $dbh = mysql_connect($host,$user,$pass) or die("Couldn't connect..."); $selected = mysql_select_db($db,$dbh); $name = $_GET['name']; $state = $_GET['state']; $desc = $_GET['desc']; $lat = $_GET['lat']; $lng = $_GET['lng']; $result = mysql_query("INSERT INTO re_cities (name, state, description, lat, lng) VALUES ('$name','$state','$desc','$lat','$lng')"); The script doesn't die when I attempt to connect so I'm assuming that isn't the problem. I'm pretty sure I also get a result because the following code echoes "City Add Successful". if ($result) { echo "City Add Successful"; } else { echo "City Add Unsuccessful"; } However, the data doesn't show up in the database.
View Replies !
Check Mysql Database For Data
Need to check if some info matches from mysql database in two tables to see if the current session user is on a friends list for the profile page he or she is viewing. If they do not exist in field, return an error. Here is the structure and what i got so far: Code:
View Replies !
Selecting Data From Database(php/mysql).
Alright I've come to a point where I only want a DB for settings and nothing based on ID's on a sql table. instead of say: $setting = mysql_query("SELECT * FROM settings WHERE id='1' "); Now i broken up all the sql into seperate settings like so: settingname | value boardonline | no Thats basicaly how I got the sql set up instead of having it all in one table row I have them in seperate rows. So how do I go about selecting data from SQL not based on ID but mainly on setting name? would I do $settings = mysql_query("SELECT * FROM settings"); $settings = mysql_fetch_array($settings); $settings['boardonline'][1];//would echo true/false according to my sql table instead of the row name?
View Replies !
Retreive Any Data From Mysql Database
I have been struggling to retreive any data from mysql database and then show it on a webpage. <? $username="root"; $password=""; $database="car"; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $sql = "SELECT * car"; $query = mysql_query($sql); while($row = mysql_fetch_assoc($query)){ Â Â echo $row['name'].' .........................................
View Replies !
Recieve Data From MySql Database
I am making a user registration that will automatically make the username the next number after the last username, and I would like after they register for the php to recieve pilot_id from the last row of the table and show it to the user, this is my current code to display successful: Code:
View Replies !
Pull Data From MySQL Database
I'm running a PHP script called phpOnDirectory on thsi website i'm creating so that people can have their companies listed in our directory. Currently, the script displayes the directory in a left-hand column, and the results in the center column. When you access a category, the script displays the number of listings withing that category in parenthesis next to the title. What my client wants is to take that out(easy enough) and have the totals listed next to the categories on the left. Code:
View Replies !
Inserting Data Into A Mysql Database Through A Php Interface
This questions relates to inserting data into a mysql database through a php interface that uses a normal html form... If I press return a couple times to make a new paragraph when filling out the text field, it never puts those line breaks into the database.. it always returns the data as one long paragraph.. How do I make it so that when a user presses return in the form, the output of data from the database knows there are supposed to be line breaks there??
View Replies !
Use A Form To Insert Data Into A MySQL Database
When you use a form to insert data into a MySQL database, how can you set it up so that the fields are not sent via the address bar. For example: page1.php ___________ <form action="page2.php"> <input type="text" value="whatever"> <input type="submit" value="Send"> page2.php ___________ // Inserts variable $whatever into database. The problem that I have is that I don't want the address bar to appear as http://web/page2.php?whatever=cheese but as http://web/page2.php
View Replies !
Insert Data From Form To MySQL Database
I have run createTable.php and everything is created. Now I want to run insertData.php. I want the user to enter stuff in the form & everything must be fill in before they click the submit button. It will call submitData() & all the information was enter will insert into the database. PHP Code:
View Replies !
Structure Of Mysql Database And Sending Data Via Php
I have set up a database with a single table called referrals. It holds records of families referred for their children to receive services from my organization. The form collects one parent's name and anywhere from 1 to 6 kids (sometimes more). So right now I have a single table with the fields parentLastName, child1name, child2name, etc. Code:
View Replies !
Posting Variable Data Into MySQL Database
I have a form on my page with a few fields. For example reasons lets say one field is "FIRSTNAME" and the other is "LASTNAME" when my page is processed it take these two fields and make these two into one word "FIRSTNAMELASTNAME" I have a this data sent to variable ($names = FISTNAMELASTNAME). How can I get this to post into my database from the variable so my insert will be "FIRSTNAMELASTNAME" I have already established my database connection. I can get data from other forms fields directly into the database. So I guess what I am asking is how can I post the data from my varibale $names. What would be the correct line of code for it.
View Replies !
Problems Adding Data Into Mysql Database
Ok, i'm designing a site for a company that has a vendor directory. Up until now I've had no problems, but basically the vendors are sorted by category,a nd then can be filtered by region. Now, I went in and added all of the UK regions instead of just england, and now I get these errors when I try to add a site. Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/weddset2/public_html/mailto.php on line 19 Warning: Cannot modify header information - headers already sent by (output started at /home/weddset2/public_html/mailto.php:19) in /home/weddset2/public_html/mailto.php on line 53 I've attached the 2 PHP files renamed as text files that are responsible for adding the vendors so hopefully one of you amazing coders out there can tell me what the heck is going on.
View Replies !
Reformatting Data In MySQL Database And Stripping The String
I have imported data via ODBC into MySQL and one of these fields is the web address. now due to the fact that MS Access formates the web address string differently, it has imported like so: www.acordis.com#http://www.acordis.com# I am initially looking to reformat this to the standard web address in the field. The second part is to strip this address and output the domain name into a separate field in the same table. i.e. from http://www.acordis.com i am looking to add acordis.com to another field called domain. Does anyone have any suggestions on how i may approach this?
View Replies !
Using A Php Html Form With Data Which Is Loaded From A Mysql Database.
I am using a php html form with data which is loaded from a mysql database. Three of the fields are textareas. The data loads into these fields fine, except that the loaded text starts at what appears to be 2 or 3 tab characters to the left. See illustration: +---------<this is a textarea object>---------+ | This is about the way that| |the text loads from the database field. | | | | | +---------------------------------------------+ It's almost as if there's a textarea "align" property which is set to "center" by default unless otherwise explicitly stated. Is there some setting in the wrap property that will fix this, or should I be looking elsewhere?
View Replies !
Script Who Can Search Data (news) From MySQL Database.
I need PHP script who can search data (news) from MySQL database. I have to create database with just one table and 5 fields: 1. News number, 2. Date, 3. News heather, 4. News, 5. Picture. Do you have this script or can you help me to create this and integrate with Database for my non profit web site.
View Replies !
Pulling Data From A MySQL Database With PHP Date Code??
I am trying to find ways to retrieve data by date from a mysql database. What I would like to do is to have the option for people to retrieve a file that was entered in the week before the current day (something like click here for all drinks added in the last week) I have tried to make this code work, the only way I can is to manually change the date every day, I would like it to do it automatically.
View Replies !
Make Data Safe To Input To Mysql Database
I'm just wondering what kind of things I should do to make sure that inputs from a form are safe to put into a mysql table? I'm currently using ereg() on an input to make sure that only numbers are entered, but on other forms I've got thiongs such as names and other details. How do I make sure that they're not going to break my table?
View Replies !
Pull Data From MySQL Database And Display On Web Page.
I am trying to pull specific data from MySQL database using PHP and have it displayed on my web page. Go to my web page to see exactly what I want to do. Right click on the link and open it in a new browser or else you will get stuck in the page. Please come back and post a reply with your knowledge. Code:
View Replies !
Nested MySQL Database Call Does Not Return Any Data
I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my skills, especially with MySQL are rudimentary</disclaimer> However my code (link below) fails, the nested database call does not return any data and this has me stumped. Code:
View Replies !
Retrieving MySQL Database Data & Updating On The Same Form...
I have managed to perform the following: 1. Adding Data to a MySQL Database. 2. Retrieving/Viewing Data from MySQL Database. I currently need to be able to perform the following: 1. While I view Data coming from the MySQL Database, I can currently edit the data on the same "view" form. Then I want to be able to save the changed data back to the Database. The problem is that when finished editing the data, the "update" button does NOT work... I want to be able to put/save the altered data back to the MySQL Database. And the button I have created does NOT work... Here is the code I use to enter NEW data to the MySQL Database: Code:
View Replies !
Security - Encrypt Data Using Php Functions Before Send It To Database (mysql)
What is more secure ? Encrypt data using php functions before send it to database (mysql), or Encrypt directly on database, using encryption functions of database server ? Ex: $key = "this is a secret key"; $input = "Let us meet at 9 o'clock at the secret place."; --- $encrypted_data = mcrypt_ecb (MCRYPT_AES, $key, $input, MCRYPT_ENCRYPT); or $query = "insert into myTable (text) values(AES_ENCRYPT('".$input."','".$key."'))"; I think encrypt data directly with php is better because the information is sent directly encrypted to database server, but i not sure.
View Replies !
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:
View Replies !
Delete Data From The Data Base
Im doing the PHP-MYSQL program to search the data in the database and display on the HTML Page. Everything is working fine till now. Now I want to know that, how to write program to delete the searched and displayed data from the database..... I know the MySQL Syntax to delete data from database...Im not asking about MySQL programming. I want just an idea, how to do the delete process. Here is My full PHP script, Code:
View Replies !
Delete Data
i try to delete the data by hit the delete button. but no changes. here i submit my coding. PHP Code: <?php if (isset($_REQUEST['delete'])) $select ="DELETE from details where amount = $nt[amount]" ?>
View Replies !
Delete From Database
I have code that does not delete from a database. The same code (cut an paste in the same file, but different function and having a different query) works. So, of course, I tested the query interactively. I echoed the query and did a cut and paste when interactively connect to the database. That one worked so it isn't the query since interactively it is seeing exactly the same thing as the code produces. Here is the code: function deleteCatalog($catalog) { $query = "DELETE FROM CatalogNames WHERE sCatalogID='" . $catalog . "'"; mssql_select_db($database_Login, $_SESSION['Login']); $result = mssql_query($query, $Login); ... } The $query echos: DELETE FROM CatalogNames WHERE sCatalogID='CMP' As an example of code that works (in the same file) function addToCatalog($cat_id, $cat_name) { $query = "INSERT INTO CatalogNames (sCatalogID, sCatalogName) " . "VALUES ('" . $cat_id . "', '" . $cat_name . "')"; mssql_select_db($database_Login, $_SESSION['Login']); $result = mssql_query($query, $_SESSION['Login']); ... } The second and third lines are identical (cut and pasted) as in other places in the same code. In fact, it is only in this file that I do all the database work. Every other function works. This is the only delete, however.
View Replies !
Delete Database
using php and mysql how can i tell the my website to move any entry older than 30 days to a different table and then delete it below i have some script i did try but this doesnt work (im using unix timestamp incase that changes anything) mysql_query(" INSERT INTO newsarchive (id, postdate, title, newstext) SELECT id, postdate, title, newstext FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)"); mysql_query("DELETE FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)"); mysql_close($link); //clean up
View Replies !
Delete Data In Flatfile?
I know this is a total noob question but im just getting into flat file scripts because a friend of mine has a site that does not have a database. so i told him ill try making him a news script made with flatfile so he doesn't have to switch hosts.. but my question is.. is there a way to delete data thats in flatfile? like set them in an array or something?
View Replies !
Recursive Database Delete
I have two tables in my database, one for the folders, where each folder has a parent id and an id itself, and one for the files where each file has a parent id for the folder its in. Now If the user deletes a folder, every file and folder within it, no matter how many there are, should be deleted. Can anyone give me the idea?
View Replies !
Delete Item From Database
I still can't figure out how to delete an item from my shoppingcart. I have tried different ways to do this, but its impossible. -a button or link that deletes a item from my database -the php script that deletes it here is a suggestion: $slett = "DELETE ID, VARE, MODELL, STR, ANTALL, PRIS, TOTALPRIS FROM USER_TRACK WHERE USER_ID = "$user_id""; But how can i assign this to a button?
View Replies !
|