I'm building a custom system for my website, that uses data from the FrontEndUsers-module. I went into PHPMyadmin to see the datastructure this module is using, so I could efficiently pull the data I wanted from the tables. Problem is, the way this module stores it's user data makes it pretty difficult to get the data out the way i would like.. Forcing me to make a query in PHP that fetches all the values from the data column that matches a certain ID, and put the data in an array. In this way, data is not always in the same order.
I'm sure there is a more efficient way to pull the exact data I want. Am I missing something?
This is an example I use:
Code: Select all
<?php
$toegewezen_1 = 'info@jumacom.nl';
$usertable='cms_module_feusers_properties'; //table
$usertable2='cms_module_feusers_users'; //table
$userid='cms_module_feusers_properties.userid';
$id='cms_module_feusers_users.id';
$title='title';
$username='username';
$data='data';
$query = "SELECT * FROM $usertable JOIN $usertable2 ON $id = $userid AND $username = '$toegewezen_1'";
//WHERE $username = $toegewezen_1
$result = mysql_query($query);
if($result) {
$datarow = array();
while($row = mysql_fetch_assoc($result)){
$datarow[] = ("$row[$data]");
}
echo '<p>'.$datarow[0].'</p>';
echo '<p>'.$datarow[1].'</p>';
echo '<p>'.$datarow[2].'</p>';
echo '<p>'.$datarow[3].'</p>';
echo '<p>'.$datarow[4].'</p>';
echo '<p>'.$datarow[5].'</p>';
echo '<p>'.$datarow[6].'</p>';
echo '<p>'.$datarow[7].'</p>';
echo '<p>'.$datarow[8].'</p>';
echo '<p>'.$datarow[9].'</p>';
}
?>


