473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

please help for beginner(php + ms access)

<html>
<head>
</head>

<body><pre>
<?php

$connection =
odbc_connect("test","root","passwd");

$query = odbc_exec($connection, "SELECT * FROM
People");

while ($row = odbc_fetch_row($result))
{
for ($i=0; $i<odbc_num_fields($result);$i++)
echo $row[$i] . " ";

echo "\n";
}

odbc_close($connection);
?>
</pre>
</body>
</html>
I got an error msg
Notice: Undefined variable: result in C:\Apache2\htdocs\test3.php on
line 14

Warning: odbc_fetch_row(): supplied argument is not a valid ODBC
result resource in C:\Apache2\htdocs\test3.php on line 14

thank in adv

Jul 17 '05 #1
2 1393
that's because you never defined the variable $result that you are
sending to the odbc_fetch_row function. try changing it to this:

while ($row = odbc_fetch_row($query))

Jul 17 '05 #2

"mattvenables" <ma**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
that's because you never defined the variable $result that you are
sending to the odbc_fetch_row function. try changing it to this:

while ($row = odbc_fetch_row($query))


or:

$result = odbc_exec($connection, "SELECT * FROM
People");

since '$result' is used twice (it's also in the loop at "for ($i=0;
$i<odbc_num_fields($result);$i++)" )

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tommy | last post by:
I try to train straight in PHP/HTML. I have many documentations read however unfortunately I didnīt find an answer for my problem : The HTML layout consists of three Frames: Top, Left and Body. ...
3
by: adam | last post by:
Hi guys i have this page and it brings over lots of varibles and also an image is being uploaded into a folder on the server here. problems is i get an error on to of the varibles and the image...
5
by: Neil McDermott | last post by:
Hello, I hope someone can help. I use a php form to process contact forms on my web sites. Recently I have been receiving lots of strange data coming through the contact forms like this : ...
8
by: effendi | last post by:
I am trying to learn how to develop using Access to front end a MS SQL back database. I am new to this so please bear with me. 1. I have a lookup table for Saluation, where I hv an ID which for...
17
by: Denebola | last post by:
I want to be able to play around with some php scripting on my pc without paying a company to host a domain. I have downloaded php onto my pc, at least I think I have, a folder called php has...
11
by: Dual_b00t | last post by:
Hi I am a beginner PHP programmer so I decided i would create a facebook group for us newbs to share and help each other out.. http://www.facebook.com/group.php?gid=20845788472 its brand new...
1
by: jmc | last post by:
I am setting up a new database at work and I am having troubles with the security. It is a simple database with 1 table, form and report. I have set up user names and passwords to get in. Is there...
0
by: SrSilveira | last post by:
Hello, google launched the google app engine, but it's fot python. So someone asked for PHP support too, if you want to use the google app engine with php, please, access this link....
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.