This is a discussion on "displaying data from my database" within the PHP Forum section. This forum, and the thread "displaying data from my database are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
displaying data from my database
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
I want to display all the info that is associated with categories but for some reason is not going though i need some help please
|
|
|
|
|||
|
Re: displaying data from my database
SELECT *FROM
U forgot the space |
|
|||
|
Re: displaying data from my database
The typo sypher mentioned was the only syntax error I found. Is this still not working?
Also, you should consider your database naming convention. A. |
|
|||
|
you think i should rename the columms in my database...
|
|
|||
|
Re: displaying data from my database
Not because of programming but because you are printing a column named slogan with the heading BusinessName, Make as ISBN, Type as State, Price as Tel, it just seems very odd.
|
|
|||
|
ok, i made changes to that already but it is still not workin,
|
|
|||
|
Re: displaying data from my database
Are you trying to do this:
I wrote this script to do what you wanted (I think) code was kinda disorderly.
|
|
|||
|
it is not going through, here is my html for
|
|
|||
|
Re: displaying data from my database
The message that i am getting is
No Category Passed, but i have data inside the database and i also have restaurant in the which is the category that i am looking for please anymore subjections i dont know what to do anymore |
|
|||
|
Re: displaying data from my database
It looks like when you say
You also need to make sure you code is reading in Categories as a Post since in your example you were doing a get so did I. Just change
|
|
|||
|
Re: displaying data from my database
i did that and nothing happend. so it seems it not passing categories..Why is that?
|
|
|||
|
Re: displaying data from my database
If i was you i would re write the script. Doing the simple functions first of passing the category var and posting the info.
Ttest if it works, then do the extra functions one at a time, testing each one. Then you will know what the problem is. |
|
|||
|
Re: displaying data from my database
Because I am lazy and didn't feel like doing anything more I changed the code to look like this:
A. |
|
|||
|
Re: displaying data from my database
I've looked through the various bits of code you have provided and noted the following problems:
In case you didn't pick up from previous posts; You have a method in your form of 'POST' but in your processing you are trying to pick up passed variables using $_GET. With regard to your database naming convention, it's a very bad idea to vae a table named the same as the database and a column the same as the table. Also modify your variable names. It's very confusing code when you have something like:
|
|
|||
|
Re: displaying data from my database
well, well, i made some changes asnf added the Post and this is what i am getting now
Array ( [make] => Massachusetts [type] => suv [Categories] => restaurant [textfield] => [submit] => Search ) No Category Passed
thank you |
|
|||
|
Ok, just for future reference the only thing that was wrong was that i have a GET instead of a POST, I changed it to Post and it works. I was just wondering what is the diffrent and when should use the GET
|
|
|||
|
Re: displaying data from my database
GET uses the url string to fetch information from it (example www.domain.com?id=5)
POST passes the info through forms. |