Im making a little blog script so people can move images around and save it.
I have the database which records all the images.
The script to move the images.
But im just stuck on the saving the left and top position into the database.
This is my database,
And basicly this is the code to get out all the images,
I want to create a funtion to save the images PHP or Javascript im not sure thats why i posted in this forum.
Thats what i tryed in JS and it worked but im not sure how to save all of the pictures in the database. (the new positions)
Thanks,
Daniel
I have the database which records all the images.
The script to move the images.
But im just stuck on the saving the left and top position into the database.
This is my database,
| Code: |
| CREATE TABLE `blogpics` (
`id` int(11) NOT NULL auto_increment, `owner` varchar(55) NOT NULL, `picurl` varchar(250) NOT NULL, `left` varchar(250) NOT NULL, `top` varchar(250) NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; |
And basicly this is the code to get out all the images,
| Code: |
| $query = mysql_query("SELECT * FROM `blogpics` WHERE `owner` = '$user'") or die (mysql_error());
while($row = mysql_fetch_array($query)){ echo '<img src="'.$row[picurl].'" style="position:relative; left:'.$row[left].'; top:'.$row[top].'" class="drag" id="'.$row[id].'">'; } |
I want to create a funtion to save the images PHP or Javascript im not sure thats why i posted in this forum.
| Code: |
| var x = document.getElementById(ID).left;
var y = document.getElementById(ID).top; |
Thats what i tryed in JS and it worked but im not sure how to save all of the pictures in the database. (the new positions)
Thanks,
Daniel
