Wrong Info sent Using $get in form


Posted on 16th Feb 2014 07:03 pm by admin

Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls help and it works ok but when i have multiple files it doesnt send the correct info.
What im tryin to get is the Num_Pages to another page it works fine if its just one file in the db but when its multiple and i select a file in the middle of the table or somewhere else i dont get tht info i get the last file info.
Can anyone help if I didnt confuse u?
Thank You
Code: <?php
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$sql = "SELECT * FROM files where username = '".$_SESSION['myusername']."' ORDER BY id ASC ";
//$sql = "ORDER BY id ASC";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);


echo "<form method='POST' action='count.php'><table border='2px'>n";
echo " <tr>n";
echo " <td align='center'>Date Added</td>n";
echo " <td align='center'>Files</td>n";
echo " <td align='center'>Number of Pages</td>n";
echo " <td align='center'>Prepare To Print</td>n";
echo " <td> </td>n";
echo " </tr>n";

for ($i = 0; $i < $rows; $i++) {
$data = mysql_fetch_object($result);
// since our script is very small, i'm not going to escape out to html mode here
echo " <tr>n";
echo " <td>$data->Date</td>n";
echo " <td>$data->File_Name</td>n";
echo " <td align='center'><input name='pages' type='hidden' value='$data->Num_Pages'>$data->Num_Pages</td>n";
echo " <td align='center'>
<input type='submit' value='Edit' name='editbutton'></form></td>";
echo " </tr>n";
}

?>

No comments posted yet

Your Answer:

Login to answer
325 Like 19 Dislike
Previous forums Next forums
Other forums

upload control not working with update panel
Hi,

I am working with Asp.Net FileUpload control with ajax update panel,

if i use the

sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fie

search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please help

Code: [Select]&l

Form help: Syntax & Logic
Hello again all,

I'm working on a form and ran into a wall (again) and can't seem to think th

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

Secure FTP
Hi experts,
There is no SFTP action in MII workbench.
This means it needs developing custo

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash