How to insert a non - database field in table.
How to insert a non - database field in table.
realdreamer
Posts: 6Questions: 0Answers: 0
Hi,
I have table with 3 ths. [code] Username Password Avatar(User's Image)[/code].
I am using the PHP Server side scripting. I also wanna display the images in the table.
If I pass the empty space for the images field, its not processing at all.
[code]$aColumns = array( 'username', 'password', ' ');[/code]
How to display the user's images within the table td.
Please help me to solve this issue.
I have table with 3 ths. [code] Username Password Avatar(User's Image)[/code].
I am using the PHP Server side scripting. I also wanna display the images in the table.
If I pass the empty space for the images field, its not processing at all.
[code]$aColumns = array( 'username', 'password', ' ');[/code]
How to display the user's images within the table td.
Please help me to solve this issue.
This discussion has been closed.
Replies
[code]
mData: 'id', // id column - string here, could be an integer if you are using plain arrays
mRender: function (d, type, row) {
return ''; // d is the id
}
[/code]
Allan
I have stored the four values in mysql table. id(Auto Increment), username, password, profile.
But in my php i am reading the 3values,
[code] $aColumns = array( 'username', 'password', 'profile'); [/code]
I want to pass the profile value into anchor tag. The code is below
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"aoColumnDefs": [ {
"aTargets": [ 2 ],
"mData": "profile",
"mRender": function ( data, type, full ) {
return 'Profile';
}
} ],
})
[/code]
But, when I try to pass the values into anchor tag. I am getting the 0(null) values in that anchor tag.
If I display directly, the profile link values are passing perfectly.
So, please kindly help me to solve this issue.
Allan
In case if i have to display the images static (without fetching it from database), but the different images I want to display..
How to do this?
Please kindly help me on this..
If i change the img tag that's working fine.
In the above table, I am retrieving the values from database.
But, my doubt is
If I change the code as below
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"aoColumnDefs": [ {
"aTargets": [ 2 ],
"mData": "profile",
"mRender": function ( data, type, full ) {
return '';
}
} ],
})
[/code]
then it displays the same image in every row. But, I want to display different images without using database.
I have mentioned that. "I want to display different images(static) without using database".
[quote]allan said: A different image based on what? [/quote]
You can certainly load images from local folder / directory.
You can have an array built within the script, assign id's for each profile and match the image name /id with the profile name / id and load that into the table. Frankly speaking, this is what happens when you use database.