Jump to content

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.