hello all
i want develop web based application
iam using apache 2.2.4 php 5.2.1 and mysql 5.0.37 (winXP)
but i stuck with some problem in my application
in my stored procedure (mysql) i use Prepared Statement for execute dynamic SQL...
and in my php script use library mysqli for connection related to database....
and while firefox load this script it take 5-6 second (looks like still loading)
and show up error mesages from windows at twice. (don't send) after that firefox just blank..
i am changed and not use dynamic sql in stored procedure, and it's work normally
when firefox load same above php script.
i trace, and found it's causes by mysqli_bind_result function...
when load this script and use prepared statement in mysql and commenting this function (mysqli_bind_result)
firefox can work normal, althought show few of warning..
i have error log too from apache that say's "Error in my_thread_global_end(): 252 threads didn't exit",
this error created when firefox has take long time this script and show error.
may be anyone have experience with this problem..
some people say that i must upgrade php. i get download and try replacing the old libmysql.dll
but i have still error..
thx ...
sorry for bad english..
for information i show my little code..
mysql stored procedure with dynamic query
DELIMITER $$
DROP PROCEDURE IF EXISTS `db_turtle`.`sp_Filter_santri_web_lengkap` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_Filter_santri_web_lengkap`(v_name varchar(100),
Start_on Int Unsigned, limit_out Int Unsigned)
BEGIN
SET @sql=CONCAT('SELECT SUBSTR(tblSantri.IdSantri,2,8) AS nostambuk, NamaLengkap
FROM tblSantri WHERE 1=1 AND tblsantri.namalengkap LIKE ', v_name);
PREPARE s1 FROM @sql;
EXECUTE s1;
DEALLOCATE PREPARE s1;
END $$
DELIMITER ;
php script that load from database
$query_sql= "CALL sp_filter_santri_web_lengkap(?,?,?)";
$query_sp = $mysql_con->prepare($query_sql);
if ($mysql_con->errno) {die($mysql_con->errno.":: ".$mysql_con->error);}
$query_sp->bind_param("sii",$full_query_search,$start_query,$end_query);
$start_query=1;
$end_query=30;
$full_query_search="'".$query_search."%' ";
$query_sp->execute();
if ($query_sp->errno) {die($query_sp->errno.": ".$query_sp->error);}
$query_sp->bind_result($array_result[0],$array_result[1]); /*<-- may source of problem..*/
$result_html="";
$line_number = 1;
while($query_sp->fetch( )){
$result_html = $result_html."<div style='position:absolute;'>".$line_number."</div>
<div style='position:relative; left:30px;'>
<div><a href='".$base_url."?menu=detail&stambuk=".$array_result[0]."'>".$array_result[1]."</a></div>
<div>Test</div></div>\n";
$line_number++;
}
$mysql_db->tutup_koneksi($mysql_con); /*closed connection*/