Delete Query Not Working As Expected
I have 2 different php forms. One makes sure that a user has chosen an unique user name (below):
$query_rsApp = "SELECT * FROM users where UserName=".$Registered." ";
This Select query works right every time (as far as I can tell). I have a form that I want to use to delete user records.
This Delete query works fine if the username and password are both numeric... But if the username or password is text, it returns the error "UNKNOWN FIELD 'whatever'" where whatever is my search criteria that I am trying to use.
View Complete Forum Thread with Replies
Related Forum Messages:
Implode() Not Working As Expected
I have one page with a form that uses an array ($order) to print out ordered items. This page then posts to a second page to get personal information from the person ordering. Before posting the form, I implode the array into another variable ($items_ordered), so that I can print a summary of the items ordered on the second page. (The following code is all within the <form> tags.): Code:
View Replies !
Ini_set() Not Working As Expected
When running the following code I get a warning: <? ini_set('session.use_cookies',0); ?> random text <? session_start(); ?> The output / warning I'm getting is this: random text Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /path/to/file.php:5) in /path/to/file.php on line 6 Shouldn't the fact that I'm setting session.use_cookies to 0, via ini_set, prevent this error from taking place?
View Replies !
If Statement Not Working As Expected.
I am trying to get my error message to print if either the login is incorrect or the dropdown variable is "Unknown" I get no errors and I know that the variable is posting correctly. I think I'm missing something or put it in the wrong place. Code:
View Replies !
Predefined Variable Not Working As Expected
I have a script that was working fine until I had to reinstall everything. Now my scripts says that : PHP Notice: Undefined index: LOGON_USER in D:Inetpubwwwroot ame.php on line 5 Where I have just made a new file to isolate the issue, but this derives from this script : <?php echo $_SERVER['LOGON_USER']; ?> Which worked fine before. Is this down to the way php is being run? As it stands it is being run via IIS 5 as cgi executable. I've looked over the install txt and it seems as though I have done everything correct.
View Replies !
Imagecolortransparent Not Working As Expected - Any Ideas?
I'm trying to rescale a gif file with transparency but am having difficulty with the imagecolortransparent() function - It's not working as I would hope... I'm telling it to replace the colour red with transparency and then overlay my transparent gif, but resized. For some reason, it is turning anything black in my transparent gif, transparent, instead of the red - Can anyone else figure out why it might be doing this? Code:
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 !
Delete Not Working
Can someone tell me why this delete isn't working: $strSQL = "DELETE FROM tblMine"; $rsEmpty = mysql_query($strSQL); I just can't get it work.
View Replies !
Delete Buttons On Form Not Working
i have the following script at the top of the page and the form below on that same page. it works in Safari and FireFox on both PC and Mac. However, in IE the page just reloads and nothing gets deleted. Any suggestions? Code:
View Replies !
Delete Query
Here’s what I’m trying to do: - Output the last 60 results in my db - works - Delete a record – does not work Can anyone see why my delete query won’t work? It seems to have two problems: 1) It does not delete a record 2) The header re-direct says can’t modify header information Code:
View Replies !
Delete Query Successful
How can I test whether a delete query on any other query for that matter has been successful deleting a record. I tried below but it does'nt return if the query deleted a record. $deletequery= "DELETE FROM details WHERE id='$line[id]' AND orderid='$orderid' AND location='".LOCATION."'"; mysql_query($deletequery) or die(ErrorDB($realname)) ; $message = (!$deletequery) ? 'ERROR' : "<font color='#FF0000'>DONE</font>"; echo "$message<br>";
View Replies !
Mysql Query : Delete From *
When I use phpmyadmin, and run this sql query, it will tell me that it affected X amount of rows (lets say 10). However, when i run my script, it doesnt' tell me that. Code:
View Replies !
Simple Delete Query
This code should delete a row from the database where ID = ID however it doesn't seem to be doing its job PHP Code: <? if(isset($_GET['id'])) { Â Â Â Â Â Â Â Â $query = "DELETE FROM mynews WHERE id = '" . $_GET['id'] . "'"; Â Â Â Â mysql_query($query); Â Â Â Â echo "<p align='center'>Deleted</p>"; Â Â Â Â } else { Â Â Â Â Â echo "<p align='center'>Not Deleted</p>"; } ?>
View Replies !
Delete Query Takes HOURS
why on EARTH would this query: Code: DELETE FROM `test_zip_assoc` WHERE id > 100000 take an entire day when there are 10 million records in this database: Code: +--------------+------------------+------+-----+---------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+------------------+------+-----+---------------+----------------+ | id | int(12) unsigned | | PRI | NULL | auto_increment | | f_id | int(12) unsigned | | | 0 | | | zip | varchar(5) | | | | | | lat_radians | decimal(12,11) | | MUL | 0.00000000000 | | | long_radians | decimal(12,11) | | MUL | 0.00000000000 | | +--------------+------------------+------+-----+---------------+----------------+
View Replies !
Query Is Not Working
Does anymone see if there is something wrong with this query it doesnt give any count result. PHP Code: $connection = mssql_connect($db_hostname, $db_username, $db_password); $db = mssql_select_db($db_name, $connection); $sql = "SELECT COUNT(intCv) AS cntCV FROM tbCV"; $result = mssql_query($sql,$connection); $row = mssql_fetch_array($result); echo '<P>Totaal aantal inschrijvingen: '.$row['COUNT(cntCV)'].'</P>'
View Replies !
Query Not Working?
I am trying to get it to insert data into two rows in a table in a database. However, not matter what I try I just can't seem to get it to work. Code:
View Replies !
Query Not Working
SELECT * FROM websites ORDER BY viewed DESC LIMIT 0 , 30 even when I do the query inside phpmyadmin, it still doesn't give the correct result (theres 3 entries, with viewed equalling 8,10,0 respectively going by ID). The correct result should be 10,8,0 but it keeps giving me 8,10,0
View Replies !
Query Working
I am trying to get it to insert data into two rows in a table in a database. However, not matter what I try I just can't seem to get it to work. PHP Code: <?php $source = "wtfemail@email.com"; $destination = "roriginal@email.com"; $link = mysql_connect('localhost', 'username', 'password'); if (!$link) { Â Â Â die('Could not connect: ' . mysql_error()); } echo 'Connected successfully' $db_selected = mysql_select_db('mail', $link); if (!$db_selected) { Â Â Â die ('error: ' . mysql_error()); }
View Replies !
Delete Query - Error In Your SQL Syntax; Check The Manual That Corresponds To Your MySQL Server
I have tried to make a delete query but it won't work it gives me a syntax error but I'm unsure where i have gone wrong.... this is what i have got at the moment: Quote$Deletesoldhouses = "DELETE * FROM soldhouses WHERE SoldHouseID = '$HouseID'"; mysql_query($Deletesoldhouses) or die(mysql_error()); Can any one see what i did wrong? Error: 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 '* FROM soldhouses WHERE SoldHouseID = '1'' at line 1
View Replies !
Get Update Query Working
I have always had a problem with updating rows in SQL, and now this is the best piece of update code I have and it wont work?!? I send the url like this edit.php?id=$id and this is my code, which just brings up a blank page weather ID is posted or even just edit.php Code:
View Replies !
Long Query Not Working
I have this query: PHP Code: $result = mysql_query("SELECT postcount,lastpostsubject,DATE_FORMAT(lastpostdate, '%d/%m/%Y'),location,DATE_FORMAT(membersince, '%d/%m/%Y'),DATE_FORMAT(lastactivedate, '%d/%m/%Y') FROM Forum_Users WHERE username='$username'", $connection); It worked fine before i added the DATE_FORMAT bits. Can anyone please tell me if they can see something wrong with this?
View Replies !
MySQL Query Not Working
This is my PHP: <?php @mysql_select_db( "inf_1235727_test", $conn ) or die( "could not select database" ); //stuff @mysql_query( "SELECT id FROM topics WHERE id = '$_GET['id']'" ) or die( "could not select query" ); ?> Working. The last MySQL Query doesnt work.
View Replies !
Insert Query Is Not Working At All
So this is my first php application I have ever made and I'm goign full out on it. I have a little bit of c++ and java skill so I'm not that stupid when it comes to programming. The problem that I am having is my insert query is not working at all and I have no clue why. Code:
View Replies !
Got A Variable In My Query But It's Not Working...
quite new to php i'm afraid, so this might be a pretty stupid question... Anyway, this is my query (or part of it): $query_recordset_ketcan = "SELECT * FROM programs WHERE zender = 'ketcan' AND date = '$checkdate' ORDER BY id ASC"; and the $checkdate has: <?php $checkdate = date('Y-m-d'); ?> but it just doesn't seem to work... The idea is that the $checkdate takes the date in that format from the server & compare that with the value in the database.
View Replies !
Mysql Error But Query Still Working
The code below is generating a number of new entries in my tries table, inserting 4 values. When $val contained an integer it worked fine, but I changed it to contain text, and suddenly I'm getting an error. Despite the error, it still inserts the correct amount of new entries in the table. What's going on? Code:
View Replies !
MySql Query Not Working, Not Giving Error
I'm running the below queries and they don't seem to be working. The code sets the value in "credits" to 0 and the value in "earned" stays the same. I'm pretty sure that the variables are all correct (As in all of the variables in the queries have a value) Code:
View Replies !
Expected Output
When I try to test my setup by making the file test.php with the single line PHP Code: <?php phpinfo(); ?> then goto http://localhost/test.php it displays Quote: <?php phpinfo(); ?> instead of all the info.
View Replies !
T_OLD_FUNCTION Expected???
I use EngIn editor, my code ran ok there... but not when I ran it on my apache server.. got the following error: Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:japachecaseFileCVf.php on line 5 Here's the code:
View Replies !
Loop Expected
i get it to loop, so that it keeps doing it for; $start =10 then 20 etc right up to 1000 the function is; function query($topic, $start = 0) { $googlelist = $this->_query("Google", $topic, $start); $yahoolist = $this->_query("Yahoo", $topic, $start); $this->found = array_unique(array_merge($googlelist, $yahoolist)); $this->counts = array("yahoo" => count($yahoolist), "google"=> count($googlelist), "total" => count($this->found)); return true;.
View Replies !
Could The Close_date Be One That Is Not The Expected Value?
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST["close_date"]; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date ("d")+7, date("Y"))); else if ($close_date == 1) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date Could the close_date be one that is not the expected value? For example, if the month is 11 and $close_date == 7, then the mktime function should return the next year for the year value, not the current year. And if the day is the last week of December, than the month and year should change if close_date == 7.
View Replies !
NULL Expected, Won't Show Up ...
I have tho following code. $_GET['artile'] looks like this: /2006/03/lorem_ipsum $locationinfo = explode('/', trim( $_GET['article'] , '/') ); list( $article_year, $article_month, $article_url ) = $locationinfo; echo '<br>year: '.(($article_year === NULL)? 'null': $article_year); echo '<br>month: '.(($article_month === NULL)? 'null': $article_month); echo '<br>article: '.(($article_url === NULL)? 'null': $article_url); The weird thing is, if $_GET['article'] is empty, $article_year isn't NULL, but the rest is. This doesn't make any sense to me ...
View Replies !
Preg_replace Not Matching As Expected
I'm attempting to write a bit of code that will parse a HTTP_REFERER from google and return the search data and the nationality (.fr, .co.uk, etc). I can get a rough output (see bellow) but the search value (2 in the script) continues past the '&' character which is where I need it to stop. PHP Code:
View Replies !
Function Not Returning Expected Value
I have a php file that contains a couple of arrays used for state/country pull-down lists. I have two global arrays and an accessor method for each. I have some simple logging methods, so I know a little bit about what I'm getting back. When I try to get the arrays from another file using the accessor methods, I get no array back. Within the file that contains the arrays, I can access them by global name and also by the accessor methods. Any ideas why I cannot access the arrays from another file? Code below. <SNIP FROM CALLING METHOD> require_once BASE . '/config/formfields.inc.php' // file with needed arrays // the calling method function display_states($smarty){ logobj(function_exists(get_states)); // returning True/1 $s = get_states(); logobj($s); // no love here logobj(BASE . '/config/formfields.inc.php'); // it's the right file }
View Replies !
CURL Results Not What Expected
I was playing with cURL on a website and it didnt work. So I switched to a different website and it worked just fine. So that little part of my brain that is always working started wondering why cURL wouldnt work with the first website that I had tried. I'm hoping that someone here can help me figure out why this particular website wont work with my cURL script, and help me get it working. Code:
View Replies !
Sort Results Not As Expected
In the actual array I'm working with, the a, b, c's are primary keys. One shouldn't expect them to actually be in order. This example uses a, b, c to verify if a sort worked properly. I want to sort the array so the result will have a,b,c,d,e,f,g,h, etc in order. Code:
View Replies !
Not Getting Expected MySQL Error
I am inserting values into a row.. works OK If I try to insert a value into a row that doesnt exist (using where) it always returns true the same as if it did work I want to update rows that have one unique field.. if the row doesnt exists it should return 0 rows updated.. I then create the row... But it always returns 1 even when I update a row that doesnt exist.. How do I get an error or a false return?
View Replies !
Ereg Not Behaving As Expected
I'm having a problem with the ereg function to verify a user submitted variable the situation is that the user is submitting a textarea post variable there are a number of allowed characters there are more in the actual application but i have removed to demonstrate the problem as removing them makes no difference the php code is as follows: $message=$_POST['textarea1']; if (ereg("^[A-Za-z0-9 ]*$",$message)) { $textValid=TRUE; } else { echo "error"; } but it seems to act like $message=$_POST['textarea1']; if (ereg("^[A-Za-z0-9]*$",$message)) { $textValid=TRUE; } else { echo "error"; }
View Replies !
Buffer Flush Doesn't Work Quite As Expected
I've got a PHP script (running on MacOS X, PHP 4.1.12) which uploads bookings from one database to another, and I'd like to have the screen show progress as it happens (each time I process a booking, I write a line summarising it to the browser with 'print') From RTFMing and Googling, it seems that I should be able to do this by turning output buffering on and using ob_flush() et al. However, this only sort-of works, in that instead of getting output line by line, I get a multi-line chunk on the browser from time to time. Am I stuck with having this chunk-by-chunk visualisation, or can anyone please suggest a way that I can make it force each line to the browser as I write it?
View Replies !
Unexpected Absence Of Expected Warning
The page 167 of book Learning PHP5 by David Sklar says that setcookie() and session_start() must be added before any output. I tried to use that functions at last line but no warning!. The warning which i got 1 month back is not issued now. ------------------------------------------------------------------ The following is my PHP program <?php function Intelli() { echo"Hello P"; } function Bitz() { echo"Hello MySQL"; } ; $a = 1; if($a) $myFunc = 'Intelli' else $myFunc ='Bitz' $myFunc(); print'header' session_start(); setcookie('userid') ?> ---------------------------------------------------------------- The following is the output i got. There is no warning [tdphpadmin@trgbws40 ~/public_html/demo]$ php dynamicfun.php X-Powered-By: PHP/5.2.0 Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/ Set-Cookie: PHPSESSID=bp1m17rlrgsa5g19tfekidov31; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre- check=0 Pragma: no-cache Set-Cookie: userid= Content-type: text/html
View Replies !
Unexpected Absence Of Expected Warning.
The page 167 of book Learning PHP5 by David Sklar says that setcookie() and session_start() must be added before any output. I tried to use that functions at last line but no warning!. The warning which i got 1 month back is not issued now. Code:
View Replies !
Regex Doesent Work Expected...
i use this to get all html tags out of an string .. preg_match_all('/<[^>]*>|[^<>]+/', $data, $contentParts); worked wonderful till i noticed that this doesent work with something like "{if $commandCount > 0}" this will be split in 2 parts: "{if $commandCount " and " 0}" and the < is gone It shouldnt split anyway when it detects an " < " or ">=" or " <=" and so on..
View Replies !
Elegantly Handling An Expected Error
I have a very modest database on my server and I use php to allow people to query it. Its very simple, they enter a value that should be in column 1 (account_num) and I return the value for column 2 (balance) (same row). Here is the question: What if the value they enter doesn't match any values in column 1? Right now, I get this ugly error message: Code:
View Replies !
|