Jump to content

Archived

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

medj

Question about MYSQL/PHP

Recommended Posts

by default, my script request MYSQL information from a database. The line I need help with is:

LIKE '$c'

I have a number of categories on my site that use the variable $c

In this mysql line, i dont want to grab info from the database with variable $c but with the variable $c + the word 'media' on the end of it.

I've tried doing                  LIKE '$cmedia'        doesnt work obviously since $cmedia is a whole new variable entirely.

I've tried              LIKE '$c+media'        doesnt work


Please anyone?

Share this post


Link to post
Share on other sites
Here are two options:

[code]" LIKE '$c" . "media" . "'"
" LIKE '{$c}media'"[/code]

You can even do complex stuff like "{$arr['fortytwo'][5]}media'".  Those {} symbols are very handy :)

Share this post


Link to post
Share on other sites
Thanks so Much  ;D

You just saved me tons of time.

Maybe you can tell me what you think of my site:

http://blankevolution.com

Share this post


Link to post
Share on other sites
Nice colours and layout.. I'm at work so I'm not going to look any closer :)

Share this post


Link to post
Share on other sites

×

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.