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

Carrying a variable from PHP form

Ok, kinda of stumped on this and i've been away from PHP development for a while some i'm a tad lost.

I have a database search for where if you enter the name of a location and submit it queries the database and returns the matches, simple enough.

Now, what I would like to do is take the ID of the entry, let's say the restaurant_id and make the display name (rest_name) as a link with that id number and be able to populate a dynamic page with the restaurant details (which would query from 2 seperate tables in the same MySQL DB).

It would include details of the location, current items and list of past items. Now how would I go about carrying the id from one dynamic page to the other and also change the name returned into a link in order to create the other page and query the two tables?

Pardon me for being such a n00b ;)
Feb 15 '07 #1
2 1250
cassbiz
202 100+
In your databases itself the field 'restaurant_id' will have to also be in the other databases.

Once you have the same field name in both (all) databases then you can query the id and have it pull from multiple databases in your select statement.

This is the easiest way.
Feb 15 '07 #2
ak1dnar
1,584 Expert 1GB
Hi xcoaster1,
Let me clear it up.I think your first page is working fine and its generating the result as per the need.so here after you want to display each an every restaurant with details.

you can do like this, display all your results as links with the names of the restaurants. then by using the restaurant ID you can call for the the next page with all the info.You have to fetch the id and assign it in a variable.

[PHP]
<a href="details.php?id=Print Your Id here">Restuarant Name</a>
[/PHP]

from the details.php page get the value using:
[PHP]
$id = $_GET['id'];
[/PHP]

coding is up to u. because u did not submit your one so far, you have completed.
Feb 19 '07 #3

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

Similar topics

3
by: Ralph Freshour | last post by:
I was reading about PHP variable scoping - it doesn't seem to support carrying any variables from one web page to another - how is this usually done? I have a lot of php variables created on my...
36
by: Richard | last post by:
My employer currently pays me $1/hour when I carry a pager. I have to carry the pager every fourth week. The problem is that my employer insists that I be available when I'm carrying the pager. ...
4
by: Ivan Shevanski | last post by:
Alright heres my problem. . .Say I want to carry over a variable from one function to another or even another run of the same function. Is that possible? Heres a quick example of what I'm talking...
3
by: tshad | last post by:
I have a User object that has all the information on the object (firstName, LastName, email, userName, password, address, gender, dob etc). I want to only carry in a session variable the logon...
4
by: Matt | last post by:
I have the following in a page and I am trying to update a record on the next page but for some reason the form data is not carrying over. Any ideas why? <form name=nxtlupdate method=post...
1
devonknows
by: devonknows | last post by:
Hi, im having trouble carrying variables across a form, ive looked on here and other sites but cant find anything that helps me, or i might not be searching for the right terms, so i though i would...
1
by: joker | last post by:
HI, Can anyone please help me with the following problem that i'm having? Basically i have a page, say for instance A.php where i have a list of clients. The names of the clients are links which...
4
by: Kurrent | last post by:
I have some data from text fields that are being passed over through a form that I am displaying with the $_POST superglobal. Once i have echo'd out this data onto the next page, i'd like to...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.