Jump to content

valency

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

valency's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can someone help interpret this for me: function totalNumof Invoices() { $sql = 'SELECT count(id) as total FROM '.$this->dbconnect->getTablePrefix().'invoices '.$where; $rsx = $this->dbconnect->querySelect($sql); } how does a query like this work exactly? seems like old php version to me...help explain the getTablePrefix().'invoices '.$where part.... the only thing declared in this frankinstein code is this: function Invoices() { $this->dbconnect->setTablePrefix($tp); $tableprefix = $tp; }
  2. Thanks. But You did not explain how i can actually declare this variable so I can call it to print later with a php tag. <?=something?>. which prints out the something variable...I know its a short tag for print. Where and how do i name a variable that i can call with the =sign too. Please.
  3. Can someone explain to me how I can create or name a variable to print like this example: <input type="button" value="<?=ADD_MORE_LINES?>" actually prints out a button with the FACE VALUE AS " ADD MORE LINES " in this gigantic code Im looking at. How do i declare a variable like this that the =sign can then be asked to print it out.tHANKS....
  4. $SCREEN = new DataScreen($_REQUEST["SCRID"]); if(isset($_REQUEST["submit"])) { switch ($_REQUEST["submit"]) { case "add": SaveScreen(); DisplayList(); break; case "set": $SCREEN->SetAgeRange($_REQUEST["agS"], $_REQUEST["agE"]); $SCREEN->SaveScreen(); DisplayQuestions(); break; case "Delete": $SCREEN->DeleteAnswer($_REQUEST["ANID"]); DisplayQuestions(); break; case "view": DisplayQuestions(); break; case "new": DisplayNewScreen(); break; case "Clone": //trying to write a function that copies what happens exactly in (case "new")function by select all from database and then displaying again on the page as well as inserting this new info in database, display list ()will certainly do this...so help with this cloning using the information hidden in the input type=hidden value=<?$scrid?> DisplayClonedScreen(); DisplayList(); break; //now to the clone function itself DisplayClonedScreen() { //copy everything from DScreen db into a new row $sql = "SELECT * from DScreen WHERE ID = ".$_REQUEST["SCRID"]; $res = mysql_query($sql); if ($res) { echo "eureka Ive each unique data returned from the database </br>"; $row = mysql_fetch_array($res); //getting the scrID returned here unique to each result but do not know how to display this result like a new screen AS the function DisplayNewScreen function does....I need to clone the results....to replicate each of the screen if and when the clone button is hit...pls help..if u get what Im saying.....(how to clone a form in a list of array of many forms with different IDs )
  5. Hey Xeno, the code worked right, the checked box stayed checked but when the update first occurs with the checked value, when u uncheck the value, it does not update after resubmitting. Do I need to include another if in the Update value or what? The code below is a continuation from the previously posted problem with checkboxes! <? //if the data gets posted, set the ID row to the checkboxes if (isset($_POST['id'])) { $checkboxofid = sizeof($_POST['id']); //count the variables $updated = 0; $inserted = 0; for ($ii=0;$ii<$checkboxofid; $ii++) { $queryupdate = 'UPDATE users SET excludeFromD = 1 WHERE userID = '.$_POST['id'][$ii]; $result3 = $db->query($queryupdate); //echo $queryupdate, "<br>"; $updated++; } echo "<BR />".$updated." account(s) updated (excluded from designs only)<br /><br />"; } ?>
  6. Cant wait to try this out, xeno, I appreciate the help, will give u a feedback if allgoes well on my dev.
  7. I can use some help in figuring out what I am doing wrong here or need to do. I am populating an array of checkboxes from the database of userID's. Any checkbox can be checked all even all based on the javascript code that I wrote for that, now I want the checkbox that are checked remain checked after the post which updates the database in another column. Here is the code so far: <? echo "<form action=\" \"method=\"POST\" name=\"theForm\"><table border=2>"; echo "<tr><th>CheckBox</th><th>Username</th><th>Password</th><th>First name</th><th>Last name</th><th>Email</th></tr>"; if ($tr > 0) { for ($cc = 0; $cc<$tr; $cc++) { $row = $db->results[$cc]; echo "<tr><td><input type=\"checkbox\" name=\"id[]\" value=\"".$row->userID."\"><td> ".$row->username."</td><td> ".$row->password." </td><td> ".$row->firstName." </td><td>".$row->lastName." </td><td> ".$row->email." </td></tr>\n"; } } echo "</table><input type=\"submit\" value=\"Click here to delete the selected accounts \"></form>"; ?> So farthis code does exactly what i Want it to do, now I want to keep the checkbox checked for each userID value boxchecked after a post or submit is set. I have tried lotsof methods including it inside the loop functions,but all wont keep the check box checked...Please help out especially in regards to this code since all other blogs were not this code specific.
×
×
  • 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.