•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,603 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,509 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3162 | Replies: 9
![]() |
here is my stored procedure
here is my php code
so far everything works fine after calling second procedure.
.... doesnt show up anything... i got empty array
i closed and opened the connection and freed the previous array etc etc..
still nothing.. anyone has idea??
thanx in advance.
sql Syntax (Toggle Plain Text)
begin SELECT indexes.IndexID, languages.LanguageID, languages.LanguageName, indexes.OrderID, indexes.IndexName FROM indexes, languages WHERE indexes.LanguageID = languages.LanguageID AND languages.LanguageID = LANGUAGE ORDER BY indexes.OrderID ASC; end
here is my php code
php Syntax (Toggle Plain Text)
<?php $Server = "127.0.0.1"; $Port = ":"."3306"; $DataBase = "abc"; $UserName = "def"; $PassWord = "blabla"; $Flags = "MYSQL_CLIENT_SSL"; $Connection = mysql_connect($Server . $Port, $UserName, $PassWord, $Flags, 65536); if(!$Connection) { die("Could not connect to server : " . mysql_error()); } else { mysql_select_db($DataBase,$Connection) or die("Could not connect to database"); } $TM = mysql_query("Call SP_Index($Language)",$Connection); while($TM_W = mysql_fetch_array($TM)) { $i1++; print $TM_W[4]; } ?>
so far everything works fine after calling second procedure.
.... doesnt show up anything... i got empty array
php Syntax (Toggle Plain Text)
<?php $Cat = mysql_query("Call SP_Category($Language)",$Connection); $Cat_N = mysql_num_rows($Cat); while($Cat_W = mysql_fetch_array($Cat)) { $i3++; print $Cat_W[4]; } ?>
still nothing.. anyone has idea??
thanx in advance.
Last edited by fatihpiristine : Nov 7th, 2007 at 7:11 pm.
mysqli version.. doesnt work also... 

php Syntax (Toggle Plain Text)
<?php $Server = "127.0.0.1"; $DataBase = "teknober"; $UserName = "root"; $PassWord = "19741968"; $Connection = mysqli_connect($Server, $UserName, $PassWord); if(!$Connection) { die("Could not connect to server : " . mysqli_error()); } else { mysqli_select_db($Connection,$DataBase) or die("Could not connect to database"); } ?> <?php print "Procedure #1<br>"; $TM = mysqli_query($Connection, "CALL mypro;"); while($TM_W = mysqli_fetch_array($TM)) { print $TM_W[2] . "<br>"; } ?> <?php print "<hr>"; print "Procedure #2<br>"; $TM = mysqli_autocommit($Connection,1); $TM = mysqli_query($Connection, "select * from news;"); while($TM_W = mysqli_fetch_array($TM)) { print $TM_W[2] . "<br>"; } ?>
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
i got a smiliar procedure to work on my server. i hope this helps.
here is the procedure:
Here is the php:
here is the procedure:
CREATE PROCEDURE SP_Index (IN lang VARCHAR(255), OUT info BLOB) BEGIN SELECT indexes.IndexID, languages.LanguageID, languages.LanguageName, indexes.OrderID, indexes.IndexName INTO info FROM indexes,languages WHERE indexes.LanguageID = languages.LanguageID AND languages.Language = lang ORDER BY indexes.OrderID ASC; END
Here is the php:
<?php
$Server = "127.0.0.1";
$Port = ":"."3306";
$DataBase = "abc";
$UserName = "def";
$PassWord = "blabla";
$Flags = "MYSQL_CLIENT_SSL";
$Connection = mysql_connect($Server . $Port, $UserName, $PassWord, $Flags, 65536);
if(!$Connection)
{
die("Could not connect to server : " . mysql_error());
}
else
{
mysql_select_db($DataBase,$Connection) or die("Could not connect to database");
}
$TM = mysql_query("Call SP_Index($Language, @data)", $Connection);
$TM2 = mysql_query('SELECT @data');
while ($TM_W = mysql_fetch_array($TM2)) {
//DO WHAT YOU WANT
}•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- PHP MySQL 5.0 stored procedure (PHP)
- how to call Stored Procedure in mysql by php (PHP)
- php mysql problem (PHP)
- how do I run a "disconnected" stored procedure (MS SQL)
- Stored procedure call with ADO (C)
- php mysql help (PHP)
- Using PHP, MySQL and Apache Server (PHP)
- DB-Authentication php/mysql on Mac OSX v3 (PHP)
Other Threads in the PHP Forum
- Previous Thread: doc root in windows virtual hosting
- Next Thread: Pagination Help


Linear Mode