Jump to content

echo a Variable from a inside Variable


Baseball

Recommended Posts

I have absolutely no idea what you're trying to do. Both...

 

$buthead = "{$row['cid']}";
$buthead = "".$_GET['f']."";

 

...seem to use redundant methods. Whilst the first is valid, why bother placing the value inside a string in that manner when you can just as easily assign $row['cid'] to $buthead using $buthead = $row['cid']. As for the second why bother appending empty strings at the start and the end, this is entirely redundant.

 

You very short explanation of your problem simply states you wish to echo out $row['cid'], which is as simple as echo $row['cid']. I'm assuming that's not what you want, but since there is no explanation of what anything in your code is supposed to do, I can't help you any further without some more accurate information.

I have absolutely no idea what you're trying to do. Both...

 

$buthead = "{$row['cid']}";
$buthead = "".$_GET['f']."";

 

...seem to use redundant methods. Whilst the first is valid, why bother placing the value inside a string in that manner when you can just as easily assign $row['cid'] to $buthead using $buthead = $row['cid']. As for the second why bother appending empty strings at the start and the end, this is entirely redundant.

 

You very short explanation of your problem simply states you wish to echo out $row['cid'], which is as simple as echo $row['cid']. I'm assuming that's not what you want, but since there is no explanation of what anything in your code is supposed to do, I can't help you any further without some more accurate information.

 

it's cause i cant put a $name inside a query from a called variable :(

That clarifies it... no more than you did before. If you honestly think you'd understand the problem based on your description so far, you're certainly a cleverer person than myself. You will need to give an example of the actual code your using and explain in what way it is not performing what you wish it to do. Alternatively if you have no idea where to start you should write out in simple English, using complete sentences exactly what you are trying to achieve. For example...

 

I have a form where the user can input a name. I need to take the name entered by the user and run a query on the database to select all rows in the table `users` that have a value in the `name` field that matches the value entered by the user. How can I achieve this?

That clarifies it... no more than you did before. If you honestly think you'd understand the problem based on your description so far, you're certainly a cleverer person than myself. You will need to give an example of the actual code your using and explain in what way it is not performing what you wish it to do. Alternatively if you have no idea where to start you should write out in simple English, using complete sentences exactly what you are trying to achieve. For example...

 

I have a form where the user can input a name. I need to take the name entered by the user and run a query on the database to select all rows in the table `users` that have a value in the `name` field that matches the value entered by the user. How can I achieve this?

 

LOL

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.