sarab99 Posted June 13, 2008 Share Posted June 13, 2008 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 More sharing options...
wildteen88 Posted June 13, 2008 Share Posted June 13, 2008 Remove the quotes around $row[salt] echo "$row[salt]".Chr(13). Chr(10); Use: echo $row['salt'] . "\n"; Link to comment https://forums.phpfreaks.com/topic/110094-solved-need-help-some-data-are-missing/#findComment-565002 Share on other sites More sharing options...
sarab99 Posted June 13, 2008 Author Share Posted June 13, 2008 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, Link to comment https://forums.phpfreaks.com/topic/110094-solved-need-help-some-data-are-missing/#findComment-565011 Share on other sites More sharing options...
kenrbnsn Posted June 13, 2008 Share Posted June 13, 2008 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 Link to comment https://forums.phpfreaks.com/topic/110094-solved-need-help-some-data-are-missing/#findComment-565064 Share on other sites More sharing options...
sarab99 Posted June 13, 2008 Author Share Posted June 13, 2008 Hi. thanks your script is working fine. But I confiused in adding one more coulumn if you dont mind to add one more column called username then I will complete the others columns by my self. many thanks sir Link to comment https://forums.phpfreaks.com/topic/110094-solved-need-help-some-data-are-missing/#findComment-565079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.