Garayed.com  

Go Back   Garayed.com > PHP
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-2006, 01:11 PM
Steve JORDI
 
Posts: n/a
Default -> Data processing in IExplorer failing / Firefox ok: why? <-

Hi,
I have a strange behavior when using IExplorer over FireFox.

There is an html form that asks for the name of a city and has
a dedicated field for that with a submit button next to it.

In IExplorer, if I hit return instead of clicking the button,
the PHP query on MySQL fails when reaching the mysql_fetch_object
function. It's ok if I click the button.

FireFox always works in both cases.

I suspect that IExplorer interprets the return as a carriage return
and inserts a control character in the query, whereas FireFox
interprets the return as a click on the submit button.

The PHP code seems ok. Here is the excerpt:

<?php
if( isset($_POST['submit'])) {
$city= $_POST['city'];
/* Connect to MySQL server and select database. */
$linkID = @mysql_connect("localhost","myuser","mypassword")
or die("Could not connect to MySQL server");
@mysql_select_db("mydatabase")
or die("Could not select database");

/* Create and execute query. */
$query = "SELECT DISTINCT CS.recID, CS.COMM,
CS.PROPRIETAIRE_DONNEE, CS.NO_REF,
CS.GENRE, CS.ESPECE, CL.NomF
FROM ChauvesSouris CS
LEFT JOIN ChauvesLangages AS CL ON CS.GENRE = CL.GENRE
AND CS.ESPECE = CL.ESPECE
WHERE CS.COMM LIKE '$city%' ORDER BY CS.COMM ;" ;

$result = mysql_query(strip_tags(htmlspecialchars($query)));
}

?>

<table cellspacing="2" cellpadding="1" border="0">
<tr>
<th class="id">ID</td>
<th class="noref">N° Ref</th>
<th class="commune">Commune</th>
<th class="proprio">Proprio</th>
<th class="genre">Genre</th>
<th class="espece">Espèce</th>
<th class="espece">Nom</th>
</tr>

<?php
while( $row = mysql_fetch_object($result) ) {
... display code here
}

---> IExplorer crashes on this while line stating that:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL
result resource in /home/www/apache/jorditests/thefile.php on line 38

Any clue why???

Thanks for any help

Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email: stevejordiK_I_L_LSPAM@hotmail.com
Switzerland WWW: www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:34 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.