Problem with 'quotation signs in MySQL requests
Posted: Thu Jun 22, 2006 5:14 pm
feyd | Please use
And here is local output:
And Remote Output
As you can see, im getting errors locally for remote output,but remotelly the local string doesnt even shoes up
Any ideas?
Thanks!@
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I really got boared of this, have dual layer SQL request and it tends to work diferently on diferent servers. If I dont have quotes inside SQL then it works localy but not remotely, and wiseversa, if i have quotes, works remotely but not locally... Yes I can bare w/ this but kind of hard to develop app. Can some one advice on how to make it work the same locally and remotely? Maybe cahnge in code or php.ini?
Here is my code:Code: Select all
<?
require("../inc/db_conn.php");
$db = mysql_connect($db_server, $db_user, $db_pass);
mysql_select_db($db_name, $db);
$sql = "select * from uc_event WHERE date >= now() ORDER BY date";
$result = mysql_query($sql);
while ($row_news = mysql_fetch_array($result)) {
//mysql_free_result($result_loc);
print("". $row_news["id"] ."<br>");
$place = $row_news["place"];
// Here Entering the second level, by using result from
//previous SELECT to SELECT WHERE
//Working LOCAL
$sql_loc = "select * from uc_club WHERE id=$place";
$result_loc = mysql_query($sql_loc);
while ($row_loc = mysql_fetch_array($result_loc)) {
print("<b>Case #1 (Local) </b> ". $row_loc["name"] ."<br>");
}
//Working REMOTE
$sql_loc2 = "select * from uc_club WHERE id='$place'";
$result_loc2 = mysql_query($sql_loc2);
while ($row_loc2 = mysql_fetch_array($result_loc2)) {
print("<b>Case #2 (Remote) </b> ". $row_loc2["name"] ."<br><br>");
}
}
?>Code: Select all
28
Case #1 (Local) QUO
Warning: mysql_query(): Unable to save result set in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 24
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 25
27
Case #1 (Local) Gypsy Tea
Warning: mysql_query(): Unable to save result set in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 24
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 25
29
Case #1 (Local) Rasputin
Warning: mysql_query(): Unable to save result set in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 24
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\template_9837_bu54w0isvwh26c90uh42\site\events\bug_tracer.php on line 25And Remote Output
Code: Select all
28
Case #1 (Local)
Case #2 (Remote) QUO
27
Case #1 (Local)
Case #2 (Remote) Gypsy Tea
29
Case #1 (Local)
Case #2 (Remote) RasputinAs you can see, im getting errors locally for remote output,but remotelly the local string doesnt even shoes up
Any ideas?
Thanks!@
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]