Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
Useful for monitoring sybase dbs, although in this instance it does not actually hit any database tables. <?php $user = "your_user"; $passwd = "password"; $host = "your_host"; $sql="select getdate(), @@version "; $conn=sybase_connect($host,$user,$pass); // connect to db print("running query host: $host\nuser: $user\n"); $result = sybase_query ( $sql ); // Run query and store in array $i = 0; while($row = sybase_fetch_array($result)) { // Loop around the array and print field or column 1 and 2 $i++; $item1 = $row[0]; $item2 = $row[1]; echo "$i $item1 $item2"; } sybase_close(); ?>
|
Leave a Reply
You must be logged in to post a comment.
June 3rd, 2007 at 11:51 pm
[…] PHP Coding School ยป Useful PHP script - running queries against sybase database (tags: Sybase PHP example Coding School) […]