473,401 Members | 2,125 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,401 software developers and data experts.

some php code needed

hi i have made a database let say estate agent which have 5 table and 10 queries
i have connected it with php using the tutorial in w3school
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?php
  4. $conn=odbc_connect('db','','');
  5. if (!$conn)
  6. {exit("Connection Failed: " . $conn);}
  7. $sql="SELECT * FROM client";
  8. $rs=odbc_exec($conn,$sql);
  9. if (!$rs)
  10. {exit("Error in SQL");}
  11. echo "<table><tr>";
  12. echo "<th>firstname</th>";
  13. echo "<th>lastname</th></tr>";
  14. while (odbc_fetch_row($rs))
  15. {
  16. $fname=odbc_result($rs,"firstname");
  17. $lname=odbc_result($rs,"lastname");
  18. echo "<tr><td>$fname</td>";
  19. echo "<td>$lname</td></tr>";
  20. }
  21. odbc_close($conn);
  22. echo "</table>";
  23. ?>
  24. </body>
  25. </html>
the result is
firstname lastname
JOHN KAY
ALIN STEWART
MIKE RITCHIE
MARY TREGEAR
PATRICK HARRISON
RONALDO GERRAD

my problem is i dont know how to bring the table name client and when i click the table name client i can get the information of that table

do i have to write alot of code?

can anyone please give me code to bring out one table name and when i click the table name
i can get the content of the table
and to bring out one query as well

i will be grateful
Oct 1 '06 #1
3 1364
ronverdonk
4,258 Expert 4TB
Do you mean that you are looking for a script that asks for the table name and, if filled in, will select the data from that table and display it?
What have you developed so far for this user interface? Show us your code.

Ronald :cool:
Oct 2 '06 #2
Do you mean that you are looking for a script that asks for the table name and, if filled in, will select the data from that table and display it?
What have you developed so far for this user interface? Show us your code.

Ronald :cool:
thank u very much for ur reply

i have not written anything anycode for the user interface yet
i will start it from tommarrow
i am new to html ,ms access, and php
so i am trying my best to understand html at the moment
so i can make a simple interface

one thing i understood is that may be i have to make some individual 20 30 page around and link them all through web interface page
am i right?

any help suggestion will do a great deal for me
regards
Oct 2 '06 #3
ronverdonk
4,258 Expert 4TB
You can do this in 2 pages, 1 for the user interface, 1 for the database select and display. The user interface page can, after the required data has been filled in, call the db page to select and display the actual db data.

When you are more experienced in PHP, you can even do both things in 1 page only. But as a start, I would go for the 2 page solution here.

Keep us informed on your progress and come back here when you need coding help.

Ronald :cool:
Oct 3 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
2
by: John Viele | last post by:
Every time I create ASP.NET pages that do any significant data access, I find myself having to deal with the same problems: managing data object creation, the SQL connection object especially. ...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
48
by: yezi | last post by:
Hi, all: I want to record some memory pointer returned from malloc, is possible the code like below? int memo_index; int i,j; char *tmp; for (i=0;i<10;i++){
56
by: richard | last post by:
So I wrote PyPI back a couple of years ago. It was just a simple cgi script and some distutils code. I needed to call it *something* and "Python Package Index" seemed like a fairly obvious name....
39
by: Digital Puer | last post by:
I'm not the world's greatest C++ programmer, so I had a hard time with these. Some help would be appreciated. 1. Comment on the declaration of function Bar() below: class Foo { static int...
3
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
11
by: Sachin Garg | last post by:
I need to build two executables from my code, one having all the code (and thus application features) and other not having it all. How to best manage the code that shouldn't go in one of the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.