Jump to content

Recommended Posts

Ok, so I want to basically be able to update multiple member statuses at once......basically I want to display a list of members that will have a textbox by them to enter data..........then I can type in each of the data that I need and it will update each and every profile with the correct data for that member.....can anyone help me figure a way to do this.....

Link to comment
https://forums.phpfreaks.com/topic/231419-run-a-report-on-a-member/
Share on other sites

That is actually what I basically need help with...........cause it is going to grab my userid I am sure and I need it not to do this......

 

Your user database would contain unique identifiers for each user correct?

 

As you build the output to the screen, set the value of the text box to the unique identifier for that user line.

 

....value="' . echo $query['unique'] . '"

searls03, as I have mentioned numerous times with your posts in the past.  If you ask better questions you will get better answers.  Show us what query/code you are using.  Then address all of the following questions..

 

1.  What error messages (if any) are you getting?

2.  What is it ACTUALLY doing?

3.  What do you EXPECT it to do?

4.  Ideally provide a sample data set.

 

There are probably more posts on your threads then anyone else due to all of the vagueness and the back and forth on all comments.

look, I am sorry alright.....I don't have a code for it right now.....that is sorta what I was hoping to get some help on............I am in the finishing stages of the website and this is one of the last things I need to get working...........so I am hoping someone can help me come up with a code that could get me STARTED......and I could hopefully go from there.......

ok, so here is what displays the search results..........I also need to know how to make this one form with one submit button show up.............it keeps on associating it with my id........can you help me associate it with the right id?

Sure, post your code.

oh, sorry, I had it copied and everything......

<form method="post" action="scoutmanager.php">
<input type="hidden" name="submitted" value="true" ?/>

<table width="896" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="127" bgcolor="#F7E496" class="adfd" scope="col"><strong>Property</strong></td>
    <td width="181" bgcolor="#F7E496" scope="col"><strong>Value</strong></td>
    <td width="588" bgcolor="#F7E496" scope="col"> </td>
    </tr>
  <tr>
    <td bgcolor="#F7E496"><select name="category">
      <option value="name">Name</option>
      <option value="address">Address</option>
      <option value="phone">Phone Number</option>
      <option value="username">Username</option>
    </select></td>
    <td bgcolor="#F7E496"><input type="text" name ="criteria" /></td>
    <td bgcolor="#F7E496"><input type="submit" /></td>
    </tr>
  <tr>
    <td bgcolor="#F7E496"> </td>
    <td bgcolor="#F7E496"> </td>
    <td bgcolor="#F7E496"> </td>
  </tr>
  <tr>
    <td bgcolor="#F7E496"> </td>
    <td bgcolor="#F7E496"> </td>
    <td bgcolor="#F7E496"> </td>
  </tr>
  </table>
</form>

<?php
if (isset($_POST['submitted'])) {
include('connect1.php');
$category = $_POST['category'];
$criteria = $_POST['criteria'] ;
$query = "SELECT * FROM members WHERE $category LIKE '%".$criteria."%'";
$result = mysqli_query($dbcon, $query) or die('error getting data');
$num_rows = mysqli_num_rows($result);
echo "$num_rows results found";
echo "<table width=\"896\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr bgcolor=\"#F7E496\"><td bgcolor=\"#F7E496\"><strong>ID</strong></td> <td bgcolor=\"#F7E496\"><strong>Merit Badges</strong></td> <td  bgcolor=\"#F7E496\"><strong></strong></td><td bgclor=\"#F7E496\"></td></tr>";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "<tr><td>";

echo $row['name'];
echo "</td><td>";
echo "<form action=\"scout.php\" method=\"post\">
  <p>
    <input name=\"badges\" id=\"badges\" type=\"text\" value=\" $badges\"/>
    <span class=\"adfa\"> <br /> (enter a ,[comma] then [space] then merit badge name)
    </span>
  </p>
  <label for=\"rank\"></label>
  <select name=\"rank\" id=\"rank\">
    <option value=\"Scout\">Scout</option>
    <option value=\"Tenderfoot\">Tenderfoot</option>
    <option value=\"Second Class Scout\">Second Class Scout</option>
    <option value=\"First Class Scout\">First Class Scout</option>
    <option value=\"Star Scout\">Star Scout</option>
    <option value=\"Life Scout\">Life Scout</option>
    <option value=\"Eagle Scout\">Eagle Scout</option>
    <option value=\"\" selected=\"selected\">$rank></option>
  </select>"
;
echo "<hr />";
echo "</td></tr>";
echo "<input type=\"hidden\" name=\"userid\" id=\"userid\">";
echo "<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Save\" />
  </p>";
echo "</form>";
}
echo "</table>";

}
?> 

btw, this is what does the posting:

<?php
session_start(); // Must start session first thing
/*
Created By Adam Khoury @ [url=http://'http://www.flashbuilding.com/']www.flashbuilding.com[/url]
-----------------------June 20, 2008-----------------------
*/
// Here we run a login check
if (!isset($_SESSION['id'])) {
echo 'Please <a href="login.php">log in</a> to access your account';
exit();
}
//Connect to the database through our include
include_once "connect_to_mysql.php";
// Place Session variable 'id' into local variable
$userid = $_SESSION['id'];

// Query member data from the database and ready it for display
$sql = mysql_query("SELECT * FROM members WHERE userid='$userid' limit 1");
while($row = mysql_fetch_array($sql)){
$userid = $row['userid'];

}



// Process the form if it is submitted
if ($_POST['rank']) {
	$badges = $_POST['badges'];
$rank = $_POST['rank'];
$sql = mysql_query("UPDATE members SET   badges='$badges', rank='$rank', userid='$userid'");
printf("Records updated: %d\n", mysql_affected_rows())
;


exit();
} // close if post
?>


  • 2 weeks later...

so I have it so it updates correct person now.......it only will display my id associated stuff in each $badges box for everyone.....:

<?php
if (isset($_POST['submitted'])) {
include('connect1.php');
$category = $_POST['category'];
$criteria = $_POST['criteria'] ;
$query = "SELECT * FROM members WHERE $category LIKE '%".$criteria."%'";
$result = mysqli_query($dbcon, $query) or die('error getting data');
$num_rows = mysqli_num_rows($result);
echo "$num_rows results found";
echo "<table width=\"896\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr bgcolor=\"#F7E496\"><td bgcolor=\"#F7E496\"><strong>name</strong></td><td bgcolor=\"#F7E496\" ><strong>Merit Badges</strong></td><td  bgcolor=\"#F7E496\"><strong>Rank</strong></td><td bgclor=\"#F7E496\"></td></tr>";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {$color = ($color == 'white')?'#fffccc':'white';
echo "<tr bgcolor='$color'><td>
<input type=\"hidden\" name=\"userid\" id=\"userid\" value=".$row['userid'].">";
echo $row['name'];
echo "
</td><td>
<form action=\"scout.php\" method=\"post\">
  
    <textarea name=\"badges\" id=\"badges\" cols=\"40\" rows=\"3\" type=\"textarea\">$badges</textarea></td><td>
    <span class=\"adfa\"> 
    </span>

  
  <label for=\"rank\"></label>
  <select name=\"rank\" id=\"rank\">
    <option value=\"Scout\">Scout</option>
    <option value=\"Tenderfoot\">Tenderfoot</option>
    <option value=\"Second Class Scout\">Second Class Scout</option>
    <option value=\"First Class Scout\">First Class Scout</option>
    <option value=\"Star Scout\">Star Scout</option>
    <option value=\"Life Scout\">Life Scout</option>
    <option value=\"Eagle Scout\">Eagle Scout</option>
    <option value=\"\" selected=\"selected\"$rank></option>

</td><td>



  ";

}
echo"
<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Save\" />
</td></tr>";
echo "</form>";
echo "</table>";

}
?>               

  • 2 weeks later...
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.