Jump to content

question


Nothadoth

Recommended Posts

I am using this to define a variable:

 

$cat = $nav['name'];

 

It works because if i tell it to echo that variable it does return words such as "The Club" which is what I want.

 

 

 

But when I select to select from a database table it doesn't work - i'll use this code (database is already connected to):

 

$querysubnav = mysql_query("SELECT * FROM nav WHERE category='$cat' ORDER BY id ASC");

 

It doesn't give any results when i display the data. However if i change it to category='The Club' it does give the results I want. But I know that the variable $cat contains "The Club" anyway.

 

 

 

Anyone help me? Ive even tried putting category='$nav['name']' and it didn't work.

Link to comment
https://forums.phpfreaks.com/topic/58654-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.