r-it Posted June 11, 2007 Share Posted June 11, 2007 i have stored a variable into my database, i would like it to be a variable instead of being plain text, eg. i store $teazer in the db right, and then before i read the database i populate the vaiable $teazer rite, then i want it to come after a certain paragraph on some other page, so i figured the way to do it was to put it inside the db and it will be invoked by that variable, can anyone help Link to comment https://forums.phpfreaks.com/topic/55070-storing-variable-in-mysql/ Share on other sites More sharing options...
kathas Posted June 11, 2007 Share Posted June 11, 2007 Simple and quick answer: You can't put a variable to a database. You can only put values to a db. I think what you want here is session variables... Check http://www.w3schools.com/php/php_sessions.asp you can always check the manual for a full reference Link to comment https://forums.phpfreaks.com/topic/55070-storing-variable-in-mysql/#findComment-272231 Share on other sites More sharing options...
r-it Posted June 11, 2007 Author Share Posted June 11, 2007 maybe i'm not making myself clear enough, its like this; i have a db with all the text for my webpages, but the main page has to show a teazer of some sort for news, so if the page being read is the main page, i have to read the news table and get the latest news item, thts no problem, but the thing is that the news block must come after the first paragraph, so i thought i'd store the variable name being used to populate the block into the database field and it would automatically know its a variable, but it just prints it as text ne1 Link to comment https://forums.phpfreaks.com/topic/55070-storing-variable-in-mysql/#findComment-272232 Share on other sites More sharing options...
kathas Posted June 11, 2007 Share Posted June 11, 2007 you are still not making yourself clear... so i thought i'd store the variable name being used to populate the block into the database field and it would automatically know its a variable who would know that??? Anyway i think i understand a bit what you want here... you want to use the variable variables feature do something like $$var_from_db anyway i still don't see why you want to do this... and i can't understand where your problem is... Link to comment https://forums.phpfreaks.com/topic/55070-storing-variable-in-mysql/#findComment-272234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.