Unable To Delete A Record Using Php
I am having a form which displays a couple of values from database and a delete button which is used to delete that particular record. Below is the code that I am using, but I am unable to delete the record. Please help me to get the record deleted. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
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 !
Delete Record
i have this code for my site that will connect to my database and grab all my members there id email and ip the problem is that it dont have a button where you can select a member and delete that member can anyone help me with this?i want to add a button and a check box so if i check off a member and click a delete button it will delete that member here is the code:
View Replies !
Delete Record!
I am using PHP5 , MySQL5, Apache 2 My Database was created with phpmyAdmin.Then I inserted with script and phpmyAdmin data into the Database. Now I am Unable to empty or delete or remove any fields out of the Database. Neither a script ot phpmyAdmin can delete.What has blocked the database? I have restarted my pc, Still I am unable to remove anything.
View Replies !
Delete Record And Files
I have a code that uploads images along with some info into a directory and database, this all works fine. I can delete the record but the images relevent to that record continue to exsist in my images directory. How would i set up a php code to delete a file in ../images when the record of its name is stored in a column in my database. Here is my delete record code:
View Replies !
Mysql Delete Record
when I run this code below it doesn't delete the record or display any error message $id = $_GET['id']; include("../dbconnect.php"); mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error()); Such a simple thing to do but I don't no why it doesn't work
View Replies !
Confirmation When Delete A Record
I want to add a confirmation before I delete a record. For example if the user wants to delete they press "Yes" otherwise "NO" and go back. <?php //delete user $sSQL = "DELETE FROM user WHERE (`userid` = ".$_GET['record_id'].")"; $result = mysql_query($sSQL) or die(mysql_error()); echo "<h1> User deleted succesfully</h1><br>"; ?>
View Replies !
Delete Record - You Have An Error In Your SQL Syntax;
Im some having trouble with deleting a record, surely it isnt that hard, dont know what im doing wrong. this is the error i am gettin: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` WHERE id=1' at line 1Here is my delete code:
View Replies !
Delete Record If Older Than 5 Minutes?
Can someone help me in writing a query command, to delete a record, if the last_update field on a record is older than 5 minutes? My table has a last_update field, which holds a value as this for example: 2007-04-08 01:33:12 I need a query that when I access a php file, if a record is older than 5 minutes, it will delete it.
View Replies !
Click Link To Delete Record
I am trying to add a function to one of my scripts. I would like to be able to click a link and have it delete a particular row from by DB. Links are generated by a PHP script and are based on entries on a DB. In this DB I have a column called 'users'. The table is generated by the following snippet: Code:
View Replies !
Dreamweaver Generated Code To Delete Record
I use the dreamweaver generated code to delete a record, how would i add some code to it to delete the files (images) stored in my../images folder, that are linked to the record being deleted, there field names are photo1, photo2, ect..... and there image names are stored in the database Code:
View Replies !
Auto Delete Record/Send Email After X Hours
What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc. I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script. A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?
View Replies !
Script Repeat Updates The Record And Also Inserts Another Record With The Same Information.
I have a form which contains some fields that are populated with data from a table. This same form also has fields that are empty because the data has not been collected yet. The main table is called client with a primary key of client_id. What I need to do with this form is select the client and update the record into a new table with the missing information. If the client doesn't not exist in this second table, I need to insert the row otherwise if the client does exist in this table because of a previous update, update the record. When I run my script, the insert works. When I try to run the script again and try to update the record, the script not only updates the record but also inserts another record with the same information. How can I write my script so it checks whether a client exists in a table and if it does, update the record and if the client does not exist in the table, add the client?
View Replies !
Compare Record With Session Variable And Update Record If Different
I'm trying to figure out how to create a session variable from a recordset field value in a mySQL database and compare this with subsequent values from the same field each time the page reloads. When the value of the field changes (as a result of a user update) I want to trigger an event (redirecting to another page). It's probably a very basic PHP function but I am a newbie with this language.
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 !
Unable To Set Cookie!
I'm unable to set cookie! I have tried a lot of codes, but it doesn't work! I don't get any error message, but the script doesn't set cookie. Below is my code:
View Replies !
Unable To Connect
Here is the setup: Server: -SQL 2000 SP3 on a win2k box -Firewall set up to allow connections for all ports ntwdblib.dll version 2.8.0 (newest) Client: XP Pro SP2 Apache 2.0.52 PHP 4.3.8.8 ntwdblib.dll version 2.8.0 (copied from server) extension=php_mssql.dll uncommented i am unable to connect to MSSQL, PHP4 through Windows XP.
View Replies !
Unable To Install PHP
I compile the latest source for php, but when I try to load php module in Apache, I get this error message: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: _efree
View Replies !
Unable To Insert
Might someone be able to tell me what is wrong with this query? Can't get it to send the data to the db. <? $date = date("Y-m-d G:i:s") ; $db="dbname"; mysql_query ("INSERT INTO dbname (var1, var2, var3, IP) VALUES ($_POST['var1'],$_POST['var2'],$_POST['var3'],$_POST['IP'])$db"); ?>
View Replies !
Unable To Add To Database Through PHP
I have written a short file called config.php that contains all of the connectivity scripting and also a db_close.php that contains the closing script. These 2 files are used thoughout the pages that I have written, so I know that the connectivity is working fine. Here is the issue. I run a simple mysql query that inserts some values into a table. After submiting the values, the script continues as if the values have been added properly, but in fact they haven't been added at all. My problem is that I do not know why it isn't being added because it return NO error in this process. Am I supposed to add some code that returns the mysql errors? Below is the line that adds the field. If this is supposed to be posted in the MySQL forum, please move it. If more info is needed pls respond. include("scripts/config.php"); mysql_query("insert into clients values ('$clientid', '$assoc', '$fn', '$ln', '$gender', '$dob', '$phoneh', '$phonec', '$phonew', '$email1', '$email2', '$email3', '$email4', '$email5', '$fnd', '$lnd', '$fnm', '$lnm', '$phonecd', '$phonecm', '$phonewd', '$phonewm', '$fax', '$address', '$city', '$province', '$pc', '$school', '$occupation', '$balance', '$notes', '$lastlog'"); include("scripts/db_close.php");
View Replies !
Unable To Jump To Row
I have a tariff which is atm 44 rows with 15 columns of numbers. Now i am trying to pull as individual price from the tariff based on user input: Code:
View Replies !
Unable To Upload
I'm not being able to upload at all, I tried to paste the sample included in the documentation and here is what came out: Code:
View Replies !
Unable To Jump Row 0
I am getting the following error: Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 2 in /home/content/i/n/n/**/html/tracker/connect.php on line 35 Here is my coding from line 34 on down. Code:
View Replies !
Unable To Upload PHP Extensions
I've come across a wierd thing in my PHP configuration. Just yesterday, I upgraded everything I had. Apache to 1.3.22, PHP to 4.1, and MySQL to 3.23.46. Everything went well and I was up and running in no time and even got Zend Optimizer to work. The problem submerged when I started adding PHP extensions. The PHP 4.1 distribution contains a lot of extensions with it. I chose modules like zlib, gd, etc. For some reason I could not get LDAP module or PDF module to work. When Apache loads, I get this message:
View Replies !
Unable To Connect To Certain SQL Servers From PHP On IIS.
I am unable to connect to certain SQL servers from PHP on IIS. I have two IIS 5 servers, both are Windows 2000 Server boxes with PHP 4.3.4 and MDAC 2.80.1022.3. I have three SQL Server machines - two SQL2K SP3a machines and one SQL 7.0 SP4 machine. One of the SQL2K servers is the same machine as one of the IIS 5 servers. One of the IIS servers, Server1, can mssql_connect to all three SQL servers. The other IIS server, Server2, can only mssql_connect to one of the SQL2K servers. I get a "connect failed" error when attempting to hit the other two SQL servers. The one it can connect to, incidentally, is the SQL server that resides on the _other_ IIS server. I have tried copying the PHP application from Server1 to Server2. The same PHP app that can connect to all three SQL Servers from Server1 can only connect to SQL on Server1 from Server2. Here's a chart of the servers: ServerName |OS |SQL Version |PHP Can connect to... -------------|-----------|----------------|------------------------- Server1 |Win2k Svr |SQL2K SP3a |Server1, Server3, Server4 Server2 |Win2k Svr |N/A |Server1 Server3 |NT 4.0 |SQL7 SP4 |N/A Server4 |Win2k3Svr |SQL2K SP3a |N/A
View Replies !
Exec(): Unable To Fork
I am trying to use exec() on windows IIS ,but i get the following error Code: Warning: exec(): Unable to fork [html2pdf.exe "http://www.yahoo.com/" "yahoo.pdf"] in c:inetpubwwwrootoctsuppublicationpublicationreport2.php on line 62 and the code that i used is Code: <? $convertpdfprg="html2pdf.exe "http://www.yahoo.com/" "yahoo.pdf""; $checkvar=exec($convertpdfprg);?>
View Replies !
Unable To Use $_SERVER['HTTP_REFERER']
Any ideas why I'm not able to use $_SERVER['HTTP_REFERER'] on my shared hosting account (PHP 4.1.2), but I can on my local server (PHP 4.3.3)? I imagine it has something to do with the different versions of PHP or perhaps php.ini, but I'm not sure what?
View Replies !
Unable To Load Library?
I restarted my virtual server on Friday night and since then I've been getting these emails every 10 minutes (there's a Cronjob scheduled to execute). Problem is, I have no idea what it means or why the error is suddenly occuring.. PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/pgsql.so' - libpq.so.3: cannot open shared object file: No such file or directory in Unknown on line 0
View Replies !
Unable To Create A Database
I am unable to create a table in SQL using PHP. I think it might jsut be a code, because it won't even show the page. It just gives me an internal error. <?php $connection = @mysql_connect("localhost","jcruz","abc2000") or die(mysql_error()); $new_db = "testDB2"; $result = @mysql_create_db($new_db, $connection) or die(mysql_error()); ?>
View Replies !
Unable To Call The Session Up
I have developed this problem as to where i am unable to call the session up in a page. The script below is the check_login.php which creates the session and all its variables. The way i am calling it is by Code:
View Replies !
Pagination Unable To Navigate
i am trying to use a pagination script that is from a tutorial on here i was given a link to and basically i can get information to display on first page and it brings up standard text saying under PREV5 1 NEXT 5 but it isnt a link or interactive so i cant get next 5 records or last so i have 5 records on screen but cant navigate between them. But i cant see why the screen shows only 5 records there are no error codes can anyone see what i have done wrong please as i feel like im going round in a circle. Code:
View Replies !
Unable To Display Graphics
PHP 5.1.6 installed on Windows 2000 server running IIS. In the php.ini file I've got extension_dir = "C:PHPext" and extension=php_gd2.dll I've also got C:PHP;C:PHPext set in the path environment variable. When I type in the command php -m, it lists out gd as one of the loaded modules. I now reboot the server. Browsing to a php page to display graphics (jpg's), it shows a 'no GD' icon where the graphics should be.
View Replies !
Unable To Send Mail
I have a small form with 3 text fields to collect the data and send an email. Scenario 1: I am collecting the data from 3 fields and I am not using these 3 values. I am sending a HTML message which is good Scenario 2: I am collecting the data from 3 fields and appending these values in the HTML message. I am unable to send a mail from here. In both the scenarios I was using header information also. Code:
View Replies !
Unable To Load Dll Mapscript_48.dll
I get this error.... Warning: dl() [function.dl]: Unable to load dynamic library '/ms4w/Apache/php/ext/php_mapscript_48.dll' - The specified procedure could not be found. in C:ms4wappsgmaphtdocsgmap75.phtml on line 56 Fatal error: Call to undefined function ms_GetVersion() in C:ms4wappsgmaphtdocsgmap75.inc.php on line 51 I'm tryin to get an application I didn't design 2 work. php_mapscript48.dll exists at the location. What do I try next? I've never dealt with dll's in php before.
View Replies !
Unable To Display Errors
I am having trouble to make PHP show errors. The hosting provider of my website won't let me have access to the php.ini file and the following code also doesn't work for me: Code: ini_set('display_errors', 1); error_reporting(E_ALL); How can I force PHP to show errors anyway. The helpdesk tells me I have to be able to take care of it im my scripts.
View Replies !
Unable To Find Package
I am trying to use MDB2 and can get SELECT queries to work fine, but when trying to INSERT, I am getting: MDB2 Error: not found (/usr/lib/php/PEAR.php at line 557) unable to find package 'MDB2_Datatype' file 'MDB2/Datatype.php' errors.
View Replies !
Unable To Start MySQL
I have just installed, PHP, Apache, on my WinXP Pro machine. I then went to install MySQL, which appeared to go well. I went into MySQL folder and opened up winmysqladmin, and clicked on Start. the response I got was unable to start try again in 30 seconds. Don;t know if this has anything to do with it, but in the books and help pages I have got, they all mention a log on page, to enter username and password, I have not seen this.
View Replies !
Unable To Connect To MySQL
I've finished coding php, run it OK with my localhost and uploaded to my Apache server with Linux OS. However, I'm seemingly unable to connect to mysql at the server side... and received the following message: Could not connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) What's this message abt? I tried to get into MySQL without php on the server.. and received the same message at the console... how come?
View Replies !
Unable To Make URL Work?
Here's what I"m using: PHP Code: $url = "<a href="http://" . $link . "/sheet.xml?" . $info[$i]['url'] . ">"; echo "<TD ALIGN = "center">" . $url . $name . "</a></TD>"; Any reason this is happening?
View Replies !
Unable To Create Socket
I have PHP5.1.2 & Apache on my PC and I'm trying to connect PHP via a socket to a java app acting as a server. I'm failing at the first PHP hurdle. The following line returns fatal error : Call to undefined function socket_create() in <filename>.php $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); Configuration: Php.ini lines default_socket_timeout = 60 extension=php_sockets.dll extension_dir = "./" ; tried with "./ext" same result... so I coppied php_sockets.dll to php5 root folder enable_dl = On ;maybe not relevant phpinfo() The only socket related items I can find are Registered Stream Socket Transports | tcp, udp default_socket_timeout | 60
View Replies !
Unable To Retrieve QUERY_STRING
I'm working on an affiliate tracking script, simple banner click thing and have hit a problem. When a customer clicks on a banner the url contains the affiliates id, i.e. 123.php?a=test . This page then forwards the customer to an enquiry form enq.php i need to try and retrieve the affiliate id (a=test) from the query string, but because 123.php forwards the customer it is always empty.
View Replies !
Unable To Add Cookies, Header Already Sent
Unable to add cookies, header already sent. File: /home/ausnrl/public_html/indexnew2.php Line: 3 I made a php page right and i put this thing in to have a vbulletin login and what happend was that comes up when i try to view the page how do i fix it?
View Replies !
Unable To Initialize Module
I've set up my PC with IIS 5.1 and PHP5. PHP is working beautifully (how I managed that, I have no idea) except when it comes to using it with MySQL (I have 4.1.14). I have written a simple test page: Code:
View Replies !
Unable To Execute Query
<? $dbh=mysql_connect("localhost","patrickh_test","slalom"); @mysql_select_db("patrickh_ratemypub") or die( "could not connect to database!"); $query="INSERT INTO pubs VALUES('$pubname','$street','$town','$county','$openinghours','$contactnumber','$lounge','$barandnightclub','$barwithnonightclub','$barandrestaurant','$barrestaurantnightclub','$description','$dance','$hiphop,'$pop','$rock','$eightys','$ninetys','$techno','$traditional','$other','$pubfood','$italien','$american','$irish','$mexican','$foodtime','$reservation')";mysql_query($query) or die("did not work"); mysql_close(); ?>
View Replies !
Unable To Create A New Directory
I recently have been researching many different forums and articles containing information on how to create a new directory with php. I still have not been able to come up with the answer. I want to be able to create a new directory based on the username that people will input. Code:
View Replies !
Unable To Run Script Via HTTP
Unable to run PHP script via HTTP Trying to install phpBB 2.0.17, when I have to run any script via HTTP to setup the forum, sometimes I see the script contents, somtimes I see a Not Found error in the browser. Running: Win XP Pro (SP2) php-5.0.4 (installed, no errors) apache_2.0.54-win32 (working) Firefox 1.0.6 IE 6.0.2900.2180 xpsp2
View Replies !
Unable To Open .tpl Files
I have an open source application. The application uses smarty templates. The problem is I am unabe to open .tpl files with Dreamweaver. Is there any other editor/software available to edit smarty templates?
View Replies !
Unable To Load Module
I am trying to load the LDAP and the MCrypt module under WinXP and PHP Version 4.3.7. The strange thing is that I have several other modules that work just fine: extension=php_bz2.dll extension=php_gd2.dll extension=php_mbstring.dll extension=php_pdf.dll extension=php_zip.dll but when I try to load also the ldap or mcrypt module, I get an error that the module cannot be found. the logifle says: PHP Warning: Unknown(): Unable to load dynamic library 'w:/server/php/php_ldap.dll' - The specified module could not be found.
View Replies !
Unable To _POST Values.
I have attacking teams and defending teams, each with their own team_id. Only attacking teams use the Attack.php page, so I capture that team_id as ateam_id. I have some functions that check their current status and whether or not they are allowed to attack. The problem is that the values I gather do not get sent to the database. I capture the attacking team when I enter the page. $ateam_id = $_GET['team_id']; as team_id is passed from the previous page. My CURRENT_TIMESTAMP() and the $action are all that get written to the table. I have not been able to capture the following: ateam_id - Attacking Team dteam_id - Defending Team tid - Current Territory. The following is an example. I am the 4th Infantry as the attacking team and I have 1st Special Forces and UK Hitlers Assasins as Defending teams. I could choose either one to attack. Code:
View Replies !
|