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

Updating and deleting from database

I have to delete data from the database. here is the sample code.


Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <title>
  4.             Edit and delete fixtures
  5.         </title>
  6.     </head>
  7.         <body>
  8.             <?php
  9.  
  10.                     $fixture_id = '';
  11.                     $update = '';
  12.                     $delete = '';
  13.                     $opponents = '';
  14.                     $date = '';
  15.                     $venue = '';
  16.                     $db_handle = '';
  17.                     $submit = '';
  18.  
  19.                 if (isset($_POST['submit1'])) {
  20.  
  21.                     $fixture_id = $_GET['fixture_id'];
  22.                     $update = $_POST['submit'];
  23.                     $opponents = $_POST['opponents'];
  24.                     $date = $_POST['date'];
  25.                     $venue = $_POST['venue'];
  26.                     $submit = $_POST['submit'];
  27.  
  28.                     $opponents = ucwords($opponents);
  29.                     $date = ucwords($date);
  30.                     $venue = ucwords($venue);
  31.  
  32.  
  33.                     $user_name = "root";
  34.                     $password = "";
  35.                     $database = "zebrascricketclub";
  36.                     $server = "127.0.0.1";
  37.                     $db_handle = mysql_connect($server, $user_name, $password);
  38.                     $db_found = mysql_select_db($database, $db_handle);
  39.  
  40.                 if($db_found) {
  41.                     //If update is yes, the form with fixtures data will be displayed ready to be edited,else if delete is yes, then the user will be asked to confirm the action, if yes then the fixture will be deleted from the database.                    if($update == 'yes') {
  42.  
  43.                     echo "<form name = "form1" method = "POST" action = "delete.php">
  44.                          </form>";
  45.  
  46.                     }
  47.  
  48.                 }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                 }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.             ?>
  64.         </body>
  65. </html>
but i get this error Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in Z:\Program Files\EasyPHP-5.3.3\www\webfiles\delete.php on line 44
Apr 29 '13 #1
1 1025
Rabbit
12,516 Expert Mod 8TB
Your code doesn't delete anything.
Apr 29 '13 #2

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

Similar topics

1
by: Greg | last post by:
I run some reports from the web that is connected to an Access database. I run a macro every 25 minutes that deletes the tables and then appends data to the tables with fresh data. The issue I have...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
3
by: adam222 | last post by:
hello, i have a web-form with a GridView control, i wanted to update & delete, using the AutoGenerateEditButton. when i used it with sqlDataSource (executing SP in the DB) it works like a...
0
by: VBNovice05 | last post by:
I am trying to update a DataSet and DataView without updating the database. I have two datasets. DataSet1: Name Size DataSet2: Name Size Path I want to look...
0
by: Johnny | last post by:
I have a PocketPC mobile application that gets its data from the Sql Server database via a web service. The web service returns a dataset that I need to load into the SqlCe database on the mobile...
1
by: Nemisis | last post by:
Hi everyone, Wonder if anyone can shed some light on how i should setup cascade deletes of object data within my database. One option is to use SQL triggers, is this a good idea? Should the...
12
by: Birky | last post by:
How can I stop a form from updating the database when a user closes the form? I have a form which is used for referencing, additions, and modifications but every time the form is closed with no...
4
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I setup a simple gridview as a utility just to do some updates, nothing fancy just wanted easy UI to make updates. When I select ‘Edit’, I get the fields I want to edit. I edit them and click...
3
by: Spoogledrummer | last post by:
Hi it's me again, still working on the sam 5 minute problem so feeling kind of thick now. I've dumped the idea of using a textarea for now and am using a textbox instead but am struggling when it...
1
by: Wavey | last post by:
Hi All, I have a problem with updating an Access database from a datatable. I have two rows of data in my database at the moment for testing, the first row is an ID number (primary key), the...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
Oralloy
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.