Jump to content

[SOLVED] need help some data are missing?


sarab99

Recommended Posts

Good day every One

 

I have made  a php script to review some filed in the database. I usually use it  with forum database.

 

the issue is when I include the salt filed to the script some of rows are missing if I remove the salt all rows are appearing.

 

I have this issue only with my script no problem with phpmyadmin.

 

any one can help please

 

the script code is below:

 

 


<?

if(empty($_POST['login']) && (empty($_POST['passwd'])) && (empty($_POST['port']))){

echo "<CENTER><form method='POST' enctype='multipart/form-data' action='$row[salt]'>

user_name <br>
<input type=\"text\" name=\"login\" value=\"\">
<br>password<br>
<input type=\"text\" name=\"passwd\" value=\"\">
<br>dataBase_Name <br>
<input type=\"text\" name=\"port\"    value=\"\"> <br>
<input type=\"submit\" value=\"Show\">
<div align=\"center\"><br></form>";

} else {
$user = $_POST['login'];
$pass = $_POST['passwd'];
$dbname = $_POST['port'] ;

$LINK = mysql_connect ("localhost","$user","$pass");

$result = mysql_db_query ("$dbname","select * from user");

echo "<CENTER><textarea cols=50 rows=20 name=\"\" READONLY>\n";

while ($row = mysql_fetch_array ($result)) {

echo "$row[salt]".Chr(13). Chr(10);

}

mysql_free_result ($result);
}

?>

 

I also uploaded the database and the script file for testing.

 

Download

http://www.t29h.com/up/uploads/0f171a4f81.zip

 

.

Link to comment
https://forums.phpfreaks.com/topic/110094-solved-need-help-some-data-are-missing/
Share on other sites

Remove the quotes around $row[salt]

echo "$row[salt]".Chr(13). Chr(10);

Use:

echo $row['salt']  . "\n";

 

Hi wildteen88 ,

 

I do the change but the result still missing rows. the total rows 12000 the reslut 9500 only. I attached the database for your reference. could you please check it.

 

regards,

 

I put your data into my local database and ran the following modification of your code:

<?php
$user = '****';
$pass = '****';
$dbname = '****' ;

$LINK = mysql_connect ("localhost",$user,$pass) or die("Couldn't connect to mysql<br>". mysql_error());
$con = mysql_select_db($dbname) or die("Couldn't select database: $dbname<br>" . mysql_error());
$q = "select salt from user";
$result = mysql_query ($q) or die("Problem with the query: $q<br>" . mysql_error());

echo '<CENTER><textarea cols=50 rows=20 name="" READONLY>';
$i = 1;
while ($row = mysql_fetch_assoc ($result)) {
echo sprintf("%5d",$i) . ': ' . $row['salt'] . "\n";
$i++;
}

?>

 

And everything seemed to print -- no missing data.

 

Ken

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.