Jump to content


Photo

variable within...


  • Please log in to reply
3 replies to this topic

#1 tgavin

tgavin
  • Members
  • PipPipPip
  • Advanced Member
  • 176 posts
  • LocationNaples, FL

Posted 19 September 2004 - 04:17 PM

How can I do this so it works?
$var1 = "hello";

if ($row_rs_mydb['$var1'] == "") {
do something }
TIA!
A noble spirit embiggens the smallest man.
- Jebediah Springfield

#2 morpheus.100

morpheus.100
  • Members
  • PipPipPip
  • Advanced Member
  • 145 posts

Posted 20 September 2004 - 12:27 PM

$var1 = "hello";

if ($row_rs_mydb['$var1'] == "hello") {
do something
} else {
do this
}

#3 tgavin

tgavin
  • Members
  • PipPipPip
  • Advanced Member
  • 176 posts
  • LocationNaples, FL

Posted 20 September 2004 - 01:51 PM

Thanks morpheus, but that won't work.

I'm creating a function that I will be using 10 times on 1 page. Each instance will have different values plugged into it. So in the first instance it will be $var1, then in the second instance it will be $var2, and so on.
A noble spirit embiggens the smallest man.
- Jebediah Springfield

#4 morpheus.100

morpheus.100
  • Members
  • PipPipPip
  • Advanced Member
  • 145 posts

Posted 20 September 2004 - 04:21 PM

Create a loop. How you run the loop is depedant upon what you aim to do with it. You could use a while satement to run the loop or perhaps a figure based upon number of rows. If using dreamweaver why not use the repeat region behavior and just modify the conditional statement to suit your needs.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users