Jump to content

PHP MySql Recordset . . . setting variables


kuyaRomeo

Recommended Posts

Two part question:

 

1)

 

I have a MySql table called "lang_key", which will store all of the common text for a site, which will allow easy site modifications from the "non tech" admin.  Now, I am creating a recordest that will pull the information from the table, and create a basic list of variables in php.

 

For example:

 

I connect to the database, and do a wildcard select.  I can figure out how to set a basic php variable like the example below:

$query1 = "SELECT * FROM lang_key";
$result = mysql_query($query1);	

while($row = mysql_fetch_array($result))
	{

		$template = $row['common_text'];



	}

 

There are three fields in my lang_key table (unique_id, string_id, and common_text')

 

What I want to do is take it a step further from the example and I want $template to be the value of "common_text" Where string_id = "curr_template"

 

I hope this makes sense?  I really just want to create my recordset and then populate the website with the recordset info.

 

 

Part II

 

Do you recommend that I use a lang_key database, or would it be simpler and more efficient to just create a lang page with static variables, and use the php file write option to update the page?

 

 

Thanks!!!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.