Unable to resolve Php vairable defined in a Database field

As per my requirement I want to implement the below scenario.
Have a table which has a field and in that fields Name META which has a value in which there is again defined a php vairbale say <?php echo $roww['title']; ?>

Now when I write my query to fetch the reqults and use

<?php echo $roww['Meta']; ?> M not able to resolve the title value it displays me <?php echo $roww['title']; ?> in the UI.

Is there any possibility where we can resolve the values to a second level.

I think it would be easyer to help you if you posted better details… can you post more code related to your variable array you have there??

Are you calling the array from another file? where is that file? etc etc

As per my requirement I want to implement the below scenario. Have a table which has a field and in that fields Name META which has a value in which there is again defined a php vairbale say

<?php 
      $sqlnew = "SELECT * FROM  `SKXD`  Where id=1";
      $resultnew = $conn->query($sqlnew);
      $roww= $resultnew->fetch_assoc();
   ?>

Is the query and m trying to reolve a filed <?php echo $roww['Meta']; ?> .

Which is there in SKXD table Value of Meta field is another php variable define i.e <?php echo $roww['Title']; ?> (which can be of same table or another table for which I tried writing query in the field itself and also on the page. This is all on index.php.

Now when i see the output i see <?php echo $roww['title']; ?>

I want to resolve the value for title field and display it.

Why all this:
there is a section on index.php where i have to display some values
Say fields A
Field B
Field C
Now these values are first added by an admin saved into the database and then displayed to the user. Now what I want is add the code of all this section alongwith PHP snippets in another table and fetch that value of 1 field which has all these php snippets. and Just add that one variable on different pages to show the same results.

Admin o frequently update the value of A B C. And currently its the same code written all pages. any change needs efforts to update manually on all pages.

Well, I am guessing you need to read up on how to JOIN two tables together. There are three types of join’s that can pull together tables. It is fairly easy to do. You link tables together based on some field that you have in both fields.

But, if you mean you want to pull PHP code from a table to display, you can not really do that. You can store code in a database and then pull it out into a temporary file and then include it into your program. But, you can not directly load PHP from a database and execute it. But, store it and then include it…

We are not clear on what you want to do.

I’m just a novice but you could try

$roww= $resultnew->fetchAll();

Always remember to back up your files before editing!

You could run separate querys for the values you are trying to get…

Sponsor our Newsletter | Privacy Policy | Terms of Service