[SOLVED] fetch_row ( mssql )

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

[SOLVED] fetch_row ( mssql )

Post by ol4pr0 »

Code: Select all

$idc = '8';
// connection and all that... 

//This works                                                                             
$result = mssql_query("exec sp_query_manhdr01");

/* this doesnt work 
* error being returned on screen 
*
* Warning: mssql_fetch_row(): supplied argument is not a valid MS SQL-result resource 
* in /usr/local/apache/htdocs/user/members/1.php on line 15
*/

$result = mssql_query("exec sp_query_manhdr01") . $idc;

while (list($fecha_envio, $hora_envio, $fecha_inicioi, $guia_madre) = mssql_fetch_row($result)) {
    echo " \n";
?>
Last edited by ol4pr0 on Thu Apr 15, 2004 1:11 pm, edited 1 time in total.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Slap me if I'm off topic =)

Are we thinking about the identifier here? Can't see other use of adding a number to the function as in your example...
mssql_query ( string query [, resource link_identifier [, int batch_size]])
...meaning:

Code: Select all

$result = mssql_query("exec sp_query_manhdr01", $idc);
However, thats not a good idea either I belive (using a static integer like that). The identifier is created when you mssql_connect() to the database.
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Yes we are talking about the identifier here...

$idc needs to be changed in to something else which is being fetch according to the users login and all that.. lots of checks before getting to that part.

Just to check i put in a $idc = '8';

however the identifier doesnt arrive @ sql
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Code: Select all

$result = mssql_query("exec sp_wquery_manhdr01 " . $idc);
worked ;-)
Post Reply