[FX.php List] Connecting PHP Web Pages with ODBC
dealTek
dealtek at gmail.com
Thu Apr 25 12:51:37 MDT 2013
On Apr 25, 2013, at 11:46 AM, John Funk <csinfo at criticalsolution.com> wrote:
> Try this for starters, I use this for reference.
>
Thanks so much John - MUCH APPRECIATED!!!!!
> <?php
> $conn=odbc_connect('dbname','username','pass'); //set the parameters for
> the connection
> if (!$conn)
> {exit("Connection Failed: " . $conn);} //exit if the connection fails
>
>
> $sql="<sql statement here>"; //set the sql statement
>
> $rs=odbc_exec($conn,$sql); //call the connection with the statement
> if (!$rs)
> {exit("Error in SQL");} //exit if thesql is bad
>
> // get the field data from the result
> while (odbc_fetch_row($rs))
> {
> $field_one=odbc_result($rs,"<field_one>");
> $field_two=odbc_result($rs,"<field_two>");
>
> echo $field_one." ". $field_two ."\n"; // show the data on your web page
> }
>
> odbc_close($conn);
> ?>
>
>
>
>>
>>
>> Hi John Glyn & Dale,
>>
>> Thanks for all the helpful tips.
>>
>> The thing I am still in the dark about is how to write the php to access
>> the filemaker database with ODBC?
>>
>> So, as a test I have succesfully created an odbc connection to a
>> (localhost) filemaker database (I also will use fmserver soon).
>>
>> Now I would like to know a way - using PHP to setup a connection to the
>> filemaker database and perform queries from a local webpage.
>>
>> Here's some connection info...
>>
>> ip = xxx.xxx.xxx.??? - any special port
>> USER DSN = test1
>> database = MyDB
>>
>> I just don't know how to write the ODBC connection code in PHP?
>>
>> Any ideas?
>>
>>
>>
>> --
>> Thanks,
>> Dave - DealTek
>> dealtek at gmail.com
>> [db-3]
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
--
Thanks,
Dave - DealTek
dealtek at gmail.com
[db-3]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20130425/b5b76f58/attachment.html
More information about the FX.php_List
mailing list