The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
First off the basics.
I've looked at PHP once or twice before, so hopefully that wont be to bad.
Did a bit on SQL ages ago as well as some database work but I'm not sure whats different between SQL and mySQL.
Have downloaded all the stuff for apache, php and mySQL from [URL]http://www.aesthetic-theory.com/learn.php?server2[/URL] and installed before but something went wrong so I'm in the process of installing again just to make sure its all working properly.
Just not sure where to start.
Have a few ebooks to try make things easier but a few things that don't seem to clear....
mySQL files, someone give me an example of one and what the file type they are?
No doubt a few more things will crop up so I'll post them here too :0)
Thanks
Cheers for the help though.
This may be a pain, but can you draw out the database design? For example:
A table
Field A (S) | Field B (N) | Field C (N) | Field D (S)
Another table
Field A (S) | Field B (S) | Field C (S) | Field D (S)
(S) = string.
(N) = numeric.
... or better yet as an image or in Excel. Its been too long since I used MySQL properly I'm afraid.
Going to look over the design of my database again just to check things are working as should then give the query another go.
Cheers for the reply
> I have a database about restaurants, one table about the restaurants
> (names, address etc) I have another table about food categories
> (which is a many to many relationship with restaurant) so another
> table with the primary keys (restaurantcategory).
>
> My query is trying to return all the restaurants that are French.
> From what I remember using in SQL I came up with this:
>
> $result = mysql_query("SELECT * FROM restaurant, foodcategory,
> restaurantcategory WHERE restaurantcategory.restaurantID =
> restaurant.restaurantID AND restaurantcategory.categoryID =
> foodcategory.categoryID AND foodCategory.foodcategory = 'French'
> ");
>
>
> But it dosn't work.
Try either:
SELECT * FROM restaurant LEFT JOIN restaurantcategory USING (restaurantID) LEFT JOIN foodcategory USING(categoryID) WHERE foodcategory.foodcategory='French'
or
SELECT * FROM restaurant
LEFT JOIN retaurantcategory ON
restaurant.restaurantID=restaurantcategory.restaurantID
LEFT JOIN foodcategory ON
restaurantcategory.categoryID=foodcategory.categoryID
WHERE foodcategory.foodcategory='French'
Also, you need to make sure the tables are type in in the same case (eg foodCategory or foodcategory) - it doesn't matter on windows but it does on linux.
> What type of query(s) are you trying to run?
I have a database about restaurants, one table about the restaurants (names, address etc) I have another table about food categories (which is a many to many relationship with restaurant) so another table with the primary keys (restaurantcategory).
My query is trying to return all the restaurants that are French. From what I remember using in SQL I came up with this:
$result = mysql_query("SELECT * FROM restaurant, foodcategory, restaurantcategory WHERE restaurantcategory.restaurantID = restaurant.restaurantID AND restaurantcategory.categoryID = foodcategory.categoryID AND foodCategory.foodcategory = 'French' ");
But it dosn't work.
What type of query(s) are you trying to run?
Having some bother getting my queries to work, not sure if it is the query thats wrong or if its to do with my joins in the tables...
Looking for some pointers..
:0(
Well at least now it works I can move on to bigger and better things. :0)
My form is bigger than that so I just took a few of them to use as an example and just forgot to remove the extra comma from the end.
Used the mysql_error() function which mentioned something about the syntax of my insert so I'll just go over that again to see if I can work out whats causing it.
Thanks
> $query = "INSERT INTO user(userID, first, last, address, town)
> VALUES (3, '$first', '$last', '$address', '$town',)";
> $result = mysql_query($query);
There's a comma there that shouldn't be there (after '$town').
If that doesn't work, you could try adding an "echo mysql_error()" line after the "$result = ..." line to see what errors mysql is reporting.