How to insert same text in one field for 10,000 records table
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Thank you for code. Now I have another question. Someone has helped me with this php code for displaying 20 rows per page. If I want to edit a particular info like email or name in that page, how do I add the code for this listing so I can edit? If possible, can you show me the modified version. Thanks.
PHP Code:
<?php
include("config.php");
# new line to config or define in script
$limitvalue = 20; # max of 20 items per page
#
print "<p class=head align=center>Listing</p>\n";
$dbConnect = mysql_pconnect(null,$dbUserName ,$dbPassword);
mysql_select_db($INFO['sql_db']) or die("Could not select database");
# get var from url
if (isset($_GET['page'])) {
$p = $_GET['page'];
} else {
$p = 1; # if no var in url show page 1
}
$startrow = ($p-1)*$limitvalue+1;
$query = "SELECT * FROM Members WHERE Approved = 'No' And 1 ORDER BY 'UserID' DESC LIMIT $startrow, $limitvalue";
$result = mysql_query($query) or die('Error '.mysql_errno().' in query: <br />'.mysql_error().'<br />');
while ($row = mysql_fetch_array($result)) {
$name = $row['Fullname'];
$surname = $row['Surname'];
$email = $row['Email'];
$approved = $row['Approved'];
echo ("
<table width='95%' align='center'>
<tr>
<td class='outline' valign='top' style='padding-left:5px;'>
<b>Full Name:</b> $surname $name<br />
<b>Email:</b> $email<br />
<b>Approved:</b> $approved<br />
</td>
</tr>
</table>
<br /> ");
}
$q = mysql_query("select COUNT(UserID) AS t from Members");
$r = mysql_fetch_assoc($q);
if ($startrow + $limitvalue < $r['t']) {
// if ($startrow + $limitvalue < mysql_num_rows($result)) { # if last showed value is not the last one show the link
$p++;
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$p.'">Next page</a>' ; }
?>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.