What is the error in getting an info from MSSQL? Enclosed herewith: an error message and source of the program
[Fri Feb 22 12:54:15 2008] [error] [client 132.64.4.16] PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL Server]Could not find stored procedure 'SHOW'., SQL state 37000 in SQLExecDirect in /srv/www/htdocs/hu/Proj1/test.php on line 9
[Fri Feb 22 12:54:15 2008] [error] [client 132.64.4.16] PHP Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /srv/www/htdocs/hu/Proj1/test.php on line 10
[Fri Feb 22 12:54:15 2008] [error] [client 132.64.4.16] PHP Warning: odbc_free_result(): supplied argument is not a valid ODBC result resource in /srv/www/htdocs/hu/Proj1/test.php on line 14
The test source program is:
--- begin odbctest.php---
<?
// connect to DSN MSSQL with a user and password
$connect = odbc_connect("DSNNAME", "user", "passwd") or die
("couldn't connect");
print "connection ok";
odbc_exec($connect, "use SwitchCenterDB");
print "SwitchCenterDB ok";
$result = odbc_exec($connect, "SHOW TABLES");
while(odbc_fetch_row($result)){
print(odbc_result($result, "CompanyName") .
' ' . odbc_result($result, "ContactName") . "\n");
}
odbc_free_result($result);
odbc_close($connect);
?>
--- end odbctest.php --
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Nice article, thanks for the
8 hours 49 min ago - I once had a better way I
14 hours 35 min ago - Not only you I too assumed
14 hours 53 min ago - another very interesting
16 hours 46 min ago - Reply to comment | Linux Journal
18 hours 39 min ago - Reply to comment | Linux Journal
1 day 1 hour ago - Reply to comment | Linux Journal
1 day 1 hour ago - Favorite (and easily brute-forced) pw's
1 day 3 hours ago - Have you tried Boxen? It's a
1 day 9 hours ago - seo services in india
1 day 14 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



same here
we encountered same problem:
[Fri Feb 22 12:54:15 2008] [error] [client 132.64.4.16] PHP Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /srv/www/htdocs/hu/Proj1/test.php on line 10
as
Warning: odbc_fetch_row(): 9 is not a valid ODBC result resource in /var/www/localhost/htdocs/customer.microprecision.com/gage.php on line 182
and my code:
<?
odbc_close($conn1);
// List Events For This Instrument
$conn2=odbc_connect($db_host,$db_user,$db_pass);
$sql2="SELECT * FROM events where events.company = '$custid' and ".
"gage_sn = '$cal' and ".
"(event_type like '%cal%' or event_type = 'Repair' or event_type = 'Op-Check')";
//echo $sql2;
//echo $cal;
$rs2=odbc_exec($conn2,$sql2);
if (!$rs2)
{exit("Error in SQL");}
?>
Event Type
Documents
Cal Date
Calibration Result
<?
odbc_fetch_row($rs2, 0);
while (odbc_fetch_row($rs2)) <------line 182------>
{
$etype=trim(odbc_result($rs2,"event_type"));
$enum=odbc_result($rs2,"event_num");
$edate=odbc_result($rs2,"event_date");
$edate = date("M-j-Y", strtotime($edate));
$eresult=trim(odbc_result($rs2,"event_result"));
?>
i wonder how you solve this one? i wish that you can help me. please send me an email --> ran.september@gmail.com thanks!
Bad SQL
The first error is the real one: You're feeding it something it doesn't know how to deal with. A bit of googling comes up with 'show tables' being a MySQL-ism - not something SQL Server is going to understand.
The other errors come from not checking the result set before trying to use it. ;-)
I am by no means an expert
I am by no means an expert on your topic but something did catch my eye. The line in your sample code:
print(odbc_result($result, "CompanyName") .
' ' . odbc_result($result, "ContactName") . "\n");
appears to me to have an extra ) between "\n" and the ;
Just a guess but if that is really in the code that could be all or part of the problem.
Happy hunting!
Mike Roberts is a bewildered Linux Journal Reader Advisory Panelist.