.PHP MySQL Query to HTML
So, this is an offshoot to my little ASP.NET experiment. That's still going strong, but I'm working two angles to compare methods.
Here's where I'm at. For starters,
Here's "2nd" (As in, my 2nd attempt writing this.)
What I'm trying to do is create a layout page of sorts that has a bunch of "blanks" for lack of a better word that are replaced with different parts of the query result.
I tried mixing and matching HTML into the code, reading online how to do it, utilizing quotes and all, but I can not get it work properly. The database is incomplete, there are a few more columns that need to be added.
The echo in the beginning is the closest I could come to creating a layout type feel, although what is echoed is not part of the result, but it simply restates what was typed in. I need that in the end, so that's good, but I can't mix the result into HTML. Any good tutorials on this would be great, I'm looking too.
Thanks in advance, as always.
Please, if in any way what I'm saying doesn't make sense, inform me. I'll try to clarify with a neat-o picture. I'm a MSPaint Wiz, and I can dandy you up with the sweet .bmp I'm visualizing in my head. It may help, it may make you wonder why I haven't considered an art major.
I don't think your code is the best/most efficient way to do this in PHP, but it looks generally like it should work. Except I think you need to kill that
Oh, WTH. I don't use PHP. But since nobody else has answered:
So maybe you do need to show that diagram?
You rock. I figured my example wouldn't be exactly cutting edge in terms of efficiency, at least your criticism of it indicates I'm slowly getting better. To boot too, you gave me exactly what I needed, the more correct way to go about things. I have some homework to do, you've introduced a few characters I'm not familiar with, but I will soon.
Now, about that picture. It's not super fancy, but maybe it can give you an idea of what I'm trying to do. The one on the left is basically what I'm picturing in my head as a layout page, the one on the right is kind of what it looks like when the query pulls information and plops in its place.
So, items in the left in quotes, are where I'd like to stick a variable that corresponds to the correct value in the search function, with it sitting in the HTML, it could then be subjected to the CSS formatting.
Does this help? I'm just trying to take raw data from a search, and make it pretty and presentable.
In the meantime, I will educate myself on your revised version of the query.
I don't think you really need much more from me. And as I said, I don't use PHP, so I'm likely not the best person to ask.
Clearly you need to make two SQL queries per HTML page: One to get the airport info (runway length, full airport name, etc., etc.) and then a separate one for the restaurants.
And of course the one for the airport info will *NOT* be in a while loop, since there will be only one record, so you probably want to just do
|All times are GMT +1. The time now is 03:25 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.