Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Fill A Array From ODBC Connection


I have a database access to which access through an ODBC connection. I wonder how can I fill in an array with the "Select" launched to the database. Thank you....




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
SQL Anywhere 5.5 Odbc Connection
Is possible connect to database SQL Anywhere 5.5 started by
rtdsk50.exe from php using odbc?

I have error : Unable to connect to database server: unable to start
database engine, SQL state 08001.

I can connect to database using the same data source from MS Access.

ODBC Connection
I tried to make an ODBC connection through PHP Page but every time the
error is genereted. The data from the page is stored in My sql database
but i couldn't get that using DSN connection in my .mdb file. I am
using this string to get the database in my .mdb file. If there is any
error i want that to be corrected.

<?

$email=$_POST['newsletter'];
$cn=odbc_connect("adim","","")or die("Counld not connect to server");
$sql="insert into test(email) values('$email')";
$rs=odbc_exec($cn,$sql) or die("Could not execute the s query");
if($rs==true)
{
print("Record Added Sucessfully");
}
else
{
print("Error on Page");
}

?>

Testing The Odbc Connection
I have just ask my web host to enable php. I was then told that we would need to test the odbc connection. How do I go about doing this?

ODBC Connection Issues
I was previously getting the error:

"Warning: SQL error: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver
specified, SQL state IM002 in SQLConnect"

but after creating System DSN (originally only
using User DSN) it appears to connect however the web
browser beeps tries to
load the page but sits there for ages with status
bar showing "waiting for localhost..." When I run
the Test in ODBC for both User & System DSN,
the test passes successfully.
The PHP script uses exactly the same DSN, username &
password.

My PC is Win2k.
My webserver is Apache 1.3.28 running on my pc.
PHP version 4.3.3
DB is running remotely on my network.

Sage Odbc Connection
I am trying to connect to Sage Line 50 data files through odbc
driver (SageLine50v8) from php5 (running on windows xp pro) by
odbc_connect().
Unfortunately I can not find right connection string and I get back an
error:
"SQL error: Cannot find all files in data path, SQL state 08001 in
SQLConnect"
This is what I am trying to do now:

$connection_string="SageLine50v8";
$conn=odbc_connect($connection_string,'marcin','my password','');

I am sure there is the way to connect to this data because I have
successfully connected from Excel using the same odbc driver.

ODBC Connection To Dbase IV?
I am trying to figure out how to query some data out of a dbase IV
(.dbf) file sitting on a remote server from my MySQL/PHP/Web Server.
Both servers are Windows Server 2003 SP2.

My MySQL/PHP/Web server is running PHP 4.3.11, MySQL 4.0.24, and IIS.
I have set a system DSN on the remote machine for the directory that...

Jet ODBC Connection Over Internal Network
We have an Access database that has been our bug reporting and tracking database for 6 years now. It is a .mdb file on one of the company servers with shared access. I am trying to establish a connection with this file for display purposes only from my web server which is just an NT station with Apache and PHP (strictly intranet usage)

I have read/write priveleges on this NT station to the location of the .mdb file. I have tried mapping a drive to that location, and connecting using UNC notation. No matter how I connect (I've created a system DSN with odbc_connect and using $conn = new COM("ADODB.Connection") I always get this error...

Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft JET Database Engine Description: The Microsoft Jet database engine cannot open the file 'G:ug databasesmgs_tblsugtables.mdb'. It is already opened exclusively by another user, or you need permission to view its data. in C:Program FilesApache GroupApache2htdocsacquisitionviewbug.php on line 11

It's definitely set up for shared access, with locked records. The system has full priveleges to the location it's stored. What setting am I missing here? Here are the lines of code used to try to establish the connection. PHP Code:

Connection And Pulling Out Information Using ODBC Functions
I know how to connect to the database, but I don't know how to pull out multiple rows from a sql statement. I know I have to use a loop, but I don't know how to use the ODBC functions. I also don't know why we execute sql statements. In the script I have, I pull out information after I prepare it using the fetch_row. Can you please help explaining the functions with examples and fix my script.

<?
$connection = @odbc_connect("db1","","") or die("Couldn't connect.");
if($connection){
$msg="success!";
}
?>
<html>
<head>
<title>ODBC Connection</title>
</head>
<body>
<?
echo "$msgn<br>";
$sql = "SELECT one, two, three from Table1";
$result = odbc_prepare($connection,$sql) or die("Couldn't connect.");
$results = odbc_execute($result);
$one = odbc_result($result,'one');
$two = odbc_result($result,'two');
$three = odbc_result($result,'three');
echo"$one";
echo"$two";
echo"$three";
?>

</body>
</html>

Save Error Msg With Odbc Connection To Oracle
Does anyone know how i can save an error massage i get from the odbc driver (connected to an oracle database)? I whant to use a stable php releas (not cvs).

Connect To Foxpro 2.6 DOS Database Using Php Odbc Connection.
The driver that I use in ODBC Data Source Administrator is Microsoft dBase Driver (*.dbf). Is it correct. Code:

Php Array Used To Fill In A Web Page
I know how to use php/mysql to fill in a page with information, but I read
a little about arrays and i think this may be an interesting and easy way
to maintain a small website. My idea is to have all the titles, descriptions, etc in one php document...

ODBC: Fetch Results As Associative Array
Will PHP fetch the results of a query using ODBC as an associative array? I know that MySQL does that, but I couldn't find it for ODBC connections.

Textarea Fill
I need an idea on how to accomplish this task. I have a script that I tried so many times to tweak but failed; so I am starting afresh. I am working on a project with PHP and MySQL and the table below is one of the tables in the db.

title_duty
id int not null auto increment
title varchar(255)
duty text

The table are populated with titles and their duties.
I need a php form with a dropdown menu of the titles of which when a user selects a title, the corresponding duty of the selected title, will display on a text area in the form; where the user can edit the duty. Now the form output can either be submitted to another table for selection with another form or can be a POST in another form. Any ideas on the best way to solve this nagging problem?

Fdf Fill Out A Form
I followed the instruction of http://fooassociates.com/phpfer/html/rn20.html

I know how to fill in the data into a form on the browser of the client.
Is it possible to fill out the form on the server and to send this as a
pdf file to the client?

Fill In Form Fields On PDF
Looking for classes or libraries which allow you to fill in form
fields on a PDF document.

Please Fill Out This Web App Development Survey
I work for a start up
company that is working out of a basement to develop a new app
framework to assist developers in writing apps that contain complicated
business rules. I'm tasked with gathering market data that we can
present to potential investors.

The survey is targeted at experienced web app developers with both
business and technical knowledge.

The survey will take about five minutes, and is located here:

Auto Fill Forms?
Is it possible to auto fill form with your information.

Example:
https://login.yahoo.com/config/mail?.intl=us

Can I Log into there with my username and password from a php file and check if the word anoluck exist.

Seach And Fill Textbox
can someone point me in the direction of script that will search a database and will offer a drop down that populates with the search results that can be selected to fill the textbox. 

Autmatic Form Field Fill
I have two fields in a form. The first is the email field the second is the username.
Now I want the username field to be filled automatically with the part before "@" of the first field.
So if someone fills in "brain@domain.com" the second field has to be filled with "brain".

Create And Fill-in Form From MySQL
I am working on an admin page where a user can input data into two text fields. When the the form is actioned the two fields are inserted into a table as a row.

What I want to do is when the user calls up the form, any rows that exsist in the table are inserted into the text fields. So the user will see x number of rows with the text fields on the form (x number being number of rows in table). The data is listed in order as determined by the MySQL query. At the end I want to add two blank text fields.

The user can then edit the data in the text fields which updates the appropiate row or enters data into the bottom (blank) text fields which adds a new row.

This is the query I have to call the data PHP Code:

Fill A Form Authenticated HTTPS
I'm searching all around the web without any good answer, maybe you have
the right one.

I'm trying to fill&send a form on a site authenticated https via curl.
The problem is simply that it doesn't arrives to authenticate..
It returns id error1 -> unsupported protocol.

The code is the following:

<?php
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

$login_url = "https://www.my_site.com/login";
$login_data = "username=my_user_name&password=my_pass";
$form_url = "https://www.my_site.com/form";
$form_data ="input1=walla&input2=test";

$ch = curl_init($login_url);

curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_COOKIEJAR, "curl_cookies");
curl_setopt($ch, CURLOPT_COOKIEFILE, "curl_cookies");
curl_setopt($ch, CURLOPT_POSTFIELDS, $login_data);

$body = curl_exec($ch); // login

curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_URL, $form_url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $form_data);

$body = curl_exec($ch); // get form results

echo "error curl_errno ($ch) <br>"; //it return error id1
curl_close($ch);
?>

Fill $_FILES Argument From XML Parser
I've a function asking for a $_FILES argument:

function insertarticle($particle,......,$pUserID,$pOptions, $files){
in this function I do add the record and then save the files in a
subdirectory specific on some datas.

This function is used by my "insert" form, letting the user to select images
files to upload with <FILE> html tag.
The files to upload are then passed to the $files like this:
insertarticle(1884,......,4,$Options,$_FILES);

for mantainance purpose, I avoid as much as possible to have the same code
in 2 different pages. Also, using actually this function to add a record in
the database (quite complex code) and saving files from a form, and using
the same function to add records from an XML parser, I can't send images
files to the function.

My parser can save the images files on the server's directory, but how to
pass $files parameters in order to save those files ? It's there any way to
take the string containing the base64 image code (I do actually save it
locally) and put it in a $_FILES array for passing it to the function ?

How Do I Fill Config.inc.php3 PHPMyAdmin?
I'm trying to install PHPMyAdmin in mysql. I have a f2s account and need to administer my dbs, after I fill it with server, user and pass the config and run localhost/../indexphp3 it try too run (many errors are in my browser):

1- left side displays phps scrips
2- getright bigings to download php.exe
3- other that I didnt remember now....

How do I fill config.inc.php3 PHPMyAdmin correctly?

$cfgServers[1]['host'] = ''
$cfgServers[1]['port'] = ''
$cfgServers[1]['adv_auth'] = false;
$cfgServers[1]['stduser'] = ''
$cfgServers[1]['stdpass'] = ''
$cfgServers[1]['user'] = ''
$cfgServers[1]['password'] = ''
$cfgServers[1]['only_db'] = ''
$cfgServers[1]['verbose'] = ''

I'm using Apache, MySql and Php4 and are working ok.

Passing Variables To Fill A Form
how can I send variables from a php page to a form - i need to fill the form with these variables? maybe using (the process of passing variables to other pages - through url) but how can i assign them to form variables ?

Print Table Cells To Fill In The End Of A Calendar
I have a variable called $rowCount that keeps track of how many total cells have been added to a table. Its actually the month view of a calendar. I need to print blank cells representing the days of the next month to fill in the cells and make the grid complete. I am almost there, I just need to figure out how to make it stop printing new cells when the $rowCount variable becomes divisible by 7. That would mean that all table rows have 7 columns, and the grid is complete. here is what I tried so far, but this just keeps printing the cells, never stopping. PHP Code:

Variable Passing To Script To Fill Html
I'm trying to do the above in order to process an image and return the
result to an html image control. It fails and my key suspects are either
the variable that I'm passing in - ImageName - for processing, or the return
data which is done (or not as the case may be) by imagejpeg($img) in the
script, after header("Content-type: image/jpeg").

Script To Automaticly Fill In Fields On A Website
I have a website that me and my friends need to vote on every day.  It has one field, the email field, and one field a image verification that you have to type in.  What I would like to do is have a script that looks opens the webpage in a new window, populates the email address from a database, then repeats for each name in the database.

That is really all it has to do, I can go and do the image verification myself, it would be nice to have something that can do that too.

Newbie Question: How Do I Fill A Table With Data From Mysql
I have a database that i hook into using php and I want to create a loop
that will create a table an populate it with data from the table but I
really am at a loss on how to achieve this.

If 10 Clients Fill Out A Form On My Page Simultaneaously And Hit Submit
If 10 clients fill out a form on my page simultaneaously and hit submit, how
does my (Apache2.0.50/PHP4.3.8) server exactly ensure each gets 'their own'
completed form returned ? Or is it possible the clients get mixed up under
some conditions?

Dynamic Fill Form Fields Depending On Dropdown Box
This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated

Select From Drop List To Fill Table Column With Text -- HOW ?
I want viewers to compare state laws on a single subject.

Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the column below.
The viewer can select states from the drop down lists above the other two
columns as well. If the viewer selects only one, only one column fills. If
the viewer selects two states, two columns fill. Etc.

I could, if appropriate, have a separate htm page with the text for each
state -- california.htm for example. When the viewer selects California from
the drop down list, the column below would "fill" with California.htm.

Or, I could conceivably use a text or mysql database with two fields for
each record: state_name and law_text -- but it would probably be easier to
use separate htm files, since there will only be about 20 states involved,
and the "database" would never have a large number of records.

The table width would be 100% and each cell would be @33%

My site is designed with FP 2002 and runs on Apache/FreeBSD. I have just had
Apache-ASP installed but I have not yet configured or used the module.

DB Connection Handling - I Get "too Many Connection" - What's The Solution?
I have a php-webpage that needs the database in the beginning and in
the end of the script. In the middle there is a lot of processing that
takes several seconds - during that time I don't use the database
connection.

What is the best approach? Should I close the connection after I'm
done with it OR should I reuse the connection thru my whole script?

Where can I read more about this? Any pointers?

Today I'm using the same connection thru my script. And sometimes I
get an error from the database "too many connections". What does that
mean? My webserver provider says that I have at least 100 connections
to play with. How come I get this error?

Php Odbc
Can anybody teach me, article/tutorials regarding PHP connection with other DB like Access and MS SQL?

PHP >> ODBC >> DBF
I need to be able to access (read and write) an older database (still
in production use) that uses dbf files (clipper-style). The php
manual says not to use the dbf functions for a production system -
corruption can occur.

Is it safe to talk to these DBs through ODBC? The machine is running
winXP, apache, and php, and so far, I have no problems getting data
from the DB files thru ODBC, but I'm a bit leery about writing...
Don't want to f' anything up.

ODBC Help
This is probably not the correct forum to post this problem but I posted it
in the Access group but didn't get a reply and I'd like to move forward on
this.

I have setup an ODBC Connection to a MySQL database (driver version is 3.51)
but when I setup the link in MS Access 2002 some of the tables will show
#Name? in all of the fields, some will show #Deleted in all of the fields
and some will work (except I can't update them). One of the table that I
get #Name? is only 2 columns created with the following SQL:

Odbc ?
I am using odbc functions to connect to access database in php.But I am using IIS on windows 2000.Whereas my client has apache on linux. Will odbc functions work on apache and linux ?

Filemaker Odbc +
is there anybody who works with filemaker and php ? I have a problem with the "+" - Charakter ! Everytime I try to update a table with an string that has a "+" inside for example:

$sql = "UPDATE test SET xy = 'Hugo + Fritz'";

in Filemaker I only can find a
Hugo Fritz
(3 spaces !)

all other charakter work fine (so far I tested it).

Odbc Errors
I am using php and sybase as a backend. To connect to sybase I am using odbc connections. the odbc connection is working fine but when I run an sql statement i get the following error:

" Warning: Supplied argument is not a valid ODBC-Link resource "

I am using an external file which holds my connection function which is:
function db_connect()
{
global $dbhost, $dbusername, $dbuserpassword, $defaultdbname, $dsn;
$myConnection = odbc_connect($dsn, $dbusername, $dbuserpassword) or die("Unable to connect to Server");
}

$myConnection = db_connect();
echo "Connected";

$mySql = "Select * from branch";
$myResult = odbc_prepare($myConnection, $mySql) or die("Could not prepare Statement");
odbc_execute($myResult) or die("Could not execute Statement");

odbc_free_result($myResult);
odbc_close($myConnection);

I get an error after the sql query. Can anyone please tell me what's wrong with this?

ODBC Link In Php
I need to use an MS Access DB on my php server. I'm having problems getting it to work though. PHP Code:

Odbc Issue
I have a php3 script that opens an access database through an odbc connection and reads the products field into a drop down combo box. The user can pick from the drop down list which record they want to delete, when they press the submit button, another php3 script I have written deletes the appropriate product from the access table. And then returns a confirmation page to the user with a link to allow them to return to the main menu.

What I can't seem to find out how to correct is... when I press the link (noted above) and return to my delete product page, the product that I just deleted, is still there. Only when I press the refresh button and reread in the script will it disappear.

Php And Odbc W/apache
I'm encountering problems with unixODBC and php. If I look at the phpinfo I
can see that it appears to have been compiled with ODBC, however, I'm
getting the IM002 error when I try to use the odbc_connect method.

I can use isql and connect fine to the DSN i've created without any
problems.

Here is the phpinfo for this particular machine I've got setup.

ODBC To MySQL
Is there a way to transfer data from a ODBC connection to MySQL
without having to create a file?

Novell ODBC
I need to acced an Novell NDS throw ODBC from php. Novell only gives a driver for windows applications. Someone know where can I find the driver to my Linux-php ?

Can't Get ODBC To Work With PHP
I've worked on this for a couple of days & can't figure out what
I'm doing wrong.

I'm trying to connect to a remote AS400 database using odbc & php.
Here's my environment:

Server: RedHat ES 2.1

IBM HTTP Server (was pre-built by IBM):
Server version: IBM_HTTP_Server/2.0.47.1 Apache/2.0.47
Server built: May 20 2004 16:46:47
Build level: WWWIHS2047/web_IHS0420.04
Server's Module Magic Number: 20020903:4
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/opt/IBMIHS"
-D SUEXEC_BIN="/opt/IBMIHS/bin/suexec"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

PHP 4.3.10, configured with:
../configure --prefix=/usr/local/php --with-apxs2=/opt/IBMIHS/bin/apxs
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-libxml-dir=/usr/lib --with-ibm-db2=/opt/IBM/db2/V8.1
--with-unixODBC=/usr/local

ODBC Blues
Just been checking out odbc. The notion of simply being able to upload
an Access file seemed cool, but writing the queries is far from
straightforward. Firstly there is the reserved word problem. It
appears you can't have a field name called 'name'. Oh...that one kept
me busy for a while.

Then there is odbc_num_rows(). Returns the number of rows right? Nope,
returns -1 for a select query.

And finally, no LIMIT so you have to run a nested select statement to
get a range of results.

All of which made something very simple, rather complicated.

So, to my question. Are there any other quirks I should know about?

DB2 Drivers? (ODBC)
I don't think IBM could make it any harder to try to find the
download you need for connecting PHP (either via DB2, or ODBC) to DB2.

I'm working on a "proof of concept" with a friend to show a company
that they don't have to jump into some seriously expensive software in
order to do simple things like a DB2 query *gasp*, and display it on a
webpage. We can access the system via ODBC from thier local Win32 ODBC,
but for the gods life of me I have no idea what to download from IBM's
site to get a linux DB2 driver. I'm trying the personal developer,
hopefully there is something smaller.

If anyone is familiar with this process, I would really appreciate a
pointer to libdb2.so.. Thats really about all I need!

PHP On FreeBSD, Can I Use ODBC Or What?
Is there anyplace that documents exactly what steps I need to take to be able to talk to an ODBC server through PHP3 on FreeBSD?

I've installed the iODBC driver manager, phpinfo() reports Unified is active -- but now what? What the heck is the next step?

AS/400, ODBC And PHP5
I'm trying to use php to extract data from an AS/400 system. The php
engine is running locally on my workstation(win2000) and I'm accessing
the DB2 database on the AS/400 system via ODBC from my workstation.

It worked in an previous installation using a dated version of php
(4.something.something, can't remember), but since I upgrated to php5
my PEAR DB module tells me I can't connect.

After a little "googling" around i only found one little newsgroup post
conserning this problem, but no solution. Acoording to that post:

http://groups.google.com/groups?q=p...U.edu.tw&rnum=1

it is a problem in php.

Have any of you a better explenation / solution / workaround to this
problem.

I really one use php5 for this (simpleXML) so....

PHP To MS Access Via ODBC
Newbie here and relative newbie to PHP.

Mentioned this on on a totally different forum so sorry if you get
this twice. I'm trying to use php to write to an access db and
haven't had any luck. Surfed the archives and tried the examples for
insert into via odbc from phpbuilder but it never writes the data to
the db.

The forms draw up properly and when I hit the submit button it goes to
the page that is supposed to run the code to write to a db but it
doesn't save. Created a system dsn via the examples as well. Have
Apache and php 5 installed on my machine.

Does anyone have examples of insert into from PHP to Access? I know
SQL Server is more stable but they've already been waiting forever
before I took the job and the project is already build in Access.
Plus this is for a low hit/ low volume survey type thing.

I don't get any error messages. It just doesn't store the data.


Copyright © 2005-08 www.BigResource.com, All rights reserved