Re: [PHP-DB] Getting error using mssql_next_result

2002-05-11 Thread Glenn Sieb

At 01:37 AM 5/11/2002 +0300, Khalid A.S. posted the following...
>Hello..  If I'm not wrong, it should be : "mysql_connect"  not 
>"mssql_connect" unless you've defined a function somewhere...

If your'e connecting to a MySQL database, yes, but if you're connecting to 
a MS SQL database, then he's correct. :)

Glenn

---
The original portions of this message are the copyright of the author
(c)1998-2002 Glenn E. Sieb.ICQ UIN: 300395IRC Nick: Rainbear
"All acts of Love and Pleasure are Her rituals"-Charge of the Goddess



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Greetings.. MSSQL and PHP question...

2002-05-01 Thread Glenn Sieb

On 12:00 PM 5/1/2002 -0400, Glenn Sieb wrote:
>I'm toying with this script I found for doing DB queries.. Up until I 
>added the print (""); code, it worked.. 
>can anyone help me find out what I'm doing wrong? (quoting the bit of the 
>script, so as not to do the TMI bit :)

*SNIP* My bad. Apparently this little query pulls out 14,000 lines.. hence 
the apparent lockup on the browser. A few minutes after posting this I got 
the page up... Thanks to everyone who posted me privately with hints and 
tips! :)

Glenn


---
Glenn E. Sieb, System Administrator
Lumeta Corp. mailto:[EMAIL PROTECTED]
+1 732 357-3514 (V)
+1 732 564-0731 (Fax)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Greetings.. MSSQL and PHP question...

2002-05-01 Thread Glenn Sieb

I'm toying with this script I found for doing DB queries.. Up until I added 
the print (""); code, it worked.. can 
anyone help me find out what I'm doing wrong? (quoting the bit of the 
script, so as not to do the TMI bit :)

What this does now is give me "560k read" and a frozen browser :(

Thanks!
Glenn


...
 $db = mssql_connect(DB_HOST, DB_USER, DB_PASS) or DIE("DATABASE 
FAILED TO RESPOND.");
 $values = array();

 if (!empty($where)){
 if (!strstr(strtolower($where),"where ")) $where = "where 
$where";
 }
 $query = "select $fields from $tables $where $groupBy $orderBy";
 echo "query=$query\n\n";
 if ($show_debug == true) echo "query=$query\n";
 $stmt = mssql_query ($query, $db) or DIE("Table unavailable");
 print ("COMPANYContact NameEmail Address");

 for ($i = 0; $i < mssql_num_rows( $stmt ); ++$i)
  {
  $line = mssql_fetch_row($stmt);
  
print("$line[0]$line[1]$line[2]");
  }
 print ("");

 @mssql_free_result ($stmt);
 @mssql_close($db);

 return $values;

}





>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

---
Glenn E. Sieb, System Administrator
Lumeta Corp. mailto:[EMAIL PROTECTED]
+1 732 357-3514 (V)
+1 732 564-0731 (Fax)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php