Hi all
If this is in the wrong place please move it.
I have been looking for some time for a tutorial or info on using a MySQL database to place objects into a members area I have built with the login tools.
GREAT tools set BTW thanks Pablo
Anyway would anybody be able to point me in the right direction please?
Limited knowledge in php but some in MySQL.
Any help very much appreciated!
Cheers
BB
Dynamically place object in page using mysql and php?
Dynamically place object in page using mysql and php?
KISS is the key!
Re: Dynamically place object in page using mysql and php?
do you mean make them visible according to the profile settings or build them dynamically?
Re: Dynamically place object in page using mysql and php?
As per the user profile settings mate, I think I should start there. Dynamically may not be the word.
I am still very much learning all this stuff
Cheers
KISS is the key!
Re: Dynamically place object in page using mysql and php?
well, in that case and as you said, you have some basic skills on database, i would start with the simplest way
let's say you have 10 elements in total to be shown them accordingly to the profile
get from the database these setting and assign to php vars, something like:
<?php
$profile_obj_1 = ...
$profile_obj_2 = ...
...etc...
?>
in these vars you may have stored two possible values: 'none' and 'block'
then, assign them to styles (in <head> section)
<style>
#my_obj_1
{
display: <?php $profile_obj_1 ?>;
}
#my_obj_2
{
display: <?php $profile_obj_2 ?>;
}
...etc...
</style>
of course you muse have already created in your html the objects that their names are 'my_obj_1', 'my_obj_2', etc...
i think this is the quickest and simplest way to start...
hope this helps you to begin, just an idea
let's say you have 10 elements in total to be shown them accordingly to the profile
get from the database these setting and assign to php vars, something like:
<?php
$profile_obj_1 = ...
$profile_obj_2 = ...
...etc...
?>
in these vars you may have stored two possible values: 'none' and 'block'
then, assign them to styles (in <head> section)
<style>
#my_obj_1
{
display: <?php $profile_obj_1 ?>;
}
#my_obj_2
{
display: <?php $profile_obj_2 ?>;
}
...etc...
</style>
of course you muse have already created in your html the objects that their names are 'my_obj_1', 'my_obj_2', etc...
i think this is the quickest and simplest way to start...
hope this helps you to begin, just an idea
Re: Dynamically place object in page using mysql and php?
RZ thank you very much mate!
That is very helpful! I will have a go and let you know what happens
I have everything up in test at the moment so it will be a few days depending on my brain
Thank you again!!
Cheers
BB
That is very helpful! I will have a go and let you know what happens
I have everything up in test at the moment so it will be a few days depending on my brain
Thank you again!!
Cheers
BB
KISS is the key!
Re: Dynamically place object in page using mysql and php?
Hi mate!
I will be comming back to this at some stage, just wanted to say thanks again for your help!
Cheers
BB
KISS is the key!
Re: Dynamically place object in page using mysql and php?
thank you for your kind words