I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back end so that a user can re-order by changing the ID number. I can get it to display the ID number in an editable text area, display thumb and title for each entry. With the code below it doesn't update the database ID number when I save. What am I doing wrong here? (Just to let you know this code is a modified version of my 'delete entry' code that works)
<?php
if($session->logged_in){
mysql_connect("localhost", "yeee", "eeeee") or die(mysql_error()) ;
mysql_select_db("eeeeee") or die(mysql_error()) ;
if(!isset($cmd))
{
$result = mysql_query("select * from test order by id");
while($r=mysql_fetch_array($result))
$title=$r["title"];
$id=$r["id"];
$thumb=$r["thumb"];
echo "<div style='display:block; width:400px; padding-left:25px;padding-right:25px; margin:auto; background-color:#ffffff;'>
<img src='images/menu-top.jpg' style='width:450px;margin-left:-25px;'><br />
<form>
<table>
<tr>
<td><input type='text' name='id' value='$id' size='3'></td><td width='350px'><strong>$title</strong></td>
</tr>
<td colspan='2' align='center'><img src='upload/test/$thumb'></td>
</table></form>";
}
}
?>
<?php
echo "<div style='text-align:center;'><a href='testorder.php?cmd=order&id=$id'>Submit</a></div>";
?>
<?php
if($cmd=="order")
{
$sql = "UPDATE test SET id='$id'";
$result = mysql_query($sql);
echo "UPDATED!";
echo "<a href='main.php'>Click here to return to the Administration Area.</a>";
}
}
else{
echo "[<a href='main.php'>Please Login</a>]";
}
?>
Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thought I could use the ASCII function, but SELECT ASCII('é') FROM DUAL in Oracle gives me 50089.
Edit MySQL Row Using PHP and HTML Form
Hello,Here's what I'm trying to do. Build a page where a user enters a MySQL row number in. Then, a new page appears with an HTML form where the user can edit the information in that row. Like for
Displaying different page content, depending on the logged in user.
Hi all, I am new to ASP.net (and web development in general), and have a question about how I can display different page content depending on the current user.I wish to create a digg style social news
SWF image using php?
Hello once again.My latest en devour requires me to produce an image of a static .swf that is embedded on a page.Unfortunately, it has a selection of variables passed to it.EgCode: <object
Creating a function
Basically i wanna put all this code in a seperate file Code: <?php $query = "select product.ProductID, product.ProductName, product.ProductCategory,
Join Query Help
Hi all,I am having problems with the below code, which we shall call 'my first join query'! Suprise suprise its not working and I am getting an error I have not seen before:QuoteParse error: parse
Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to change the font and font size. Is there anyone here that know what code i should edit/paste in
How to show more than 1 users with this code...
Hello,i have a table that shows users only if I, as Administrator, want to be shown. But its showing just 1 user and i want to show at least 4. If i copy the code, or use loop, its showing the same
A little help in c#
i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the panel events but i want to add a button and when i press the button this events happen how can i do
Problem with DB connection
Hello there! I'm new to this forum and I'm new to PHP coding also. I wrote something that doesn't make exactly what I thought it will. Can you give me a hand please. There we go:Code: [Select]