Jump to content

luvburn

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

luvburn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok... i have one page that have a recordset with radio button in it. The recordset only display 10 records. User will have to click 'next' button to see another 10 records and so on. How do i keep the value of radio button for each records cause whenever i go to the next page, the value from previous page disappear, the submit button is at the last page. I want to submit all radio buttons values to another page.
  2. The session is not working. Somehow i want to use the values in page2. So i use $_GET to get the values from page 1 using the URL links. After that i want to send the values to page3. Page 2 has a lot of server side functions. The values only appear for the first time we view the page but lost each time some of those functions operated. So how do i hold the values from page1 no matter functions operated in page2. this the code in page 2 [code] <?php include ('mysql_connect.php'); include ('papar_fungsi.php'); session_start(); session_name ('diagnos');   $_SESSION['age'] =  $_GET["umur"];   $_SESSION['sex'] = $_GET["jantina"];   $_SESSION['race'] = $_GET["kaum"]; ?> <form name="form1" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <?php :   $_SESSION['age'] .... (a lot of php function here) ?> </form> <?php   echo "<a href=\"senarai_simptom.php?a=$age\">Simptom</a> " ; ?> [/code] I want the values to be send after clicking the 'Simptom' link but as i said before, the values lost before i can send to page3.
  3. Hi...i have this problem of linking 2 pages from one button. Let say i have 3 pages. I want to send the values from page 1 to page 2 and 3. This the code for page 1 which i set the action to go to page2 [code] <?php <form name="form1" method="get" action="page2.php"> <table width="585" align="center"> <tr> <td>Umur :</td> <td ><input type="radio" name="umur" value="1"> < 1 tahun</td> <td ><input type="radio" name="umur" value="2" >1 - 10 tahun</td> <td><input type="radio" name="umur" value="3" > 11 - 19 tahun</td> <td ><input type="radio" name="umur" value="4" >  19 tahun</td> </tr> </table> <input type="submit" name="submit" value="Teruskan" > </form> ?> [/code] I can simply get the values at page2 by using $_GET. How do i do the same action to page 3 by clicking the submit button and retrieving the same values so that whenever i go to page3 the values from page1 is already there. Where should i put the link?
  4. I got this page simptom.php that when i click the submit button the page diagnos.php will appear. But i want the values from simptom.php can be viewed in another page called list.php. How do i do that by using session? Here is the code for simptom.php and i created a session for this page. [code] <?php session_name ('diagnos');           session_start(); ?>             <form name="form1" method="get" action="diagnos.php" >             <table><tr> <td width="89" align="right" class="tbody2">Umur :</td> <td width="107" class="tbody"><input type="radio" name="age" value="1"> < 1 tahun</td> <td width="124" class="tbody"><input type="radio" name="age" value="2"> 1 - 10 tahun</td> <td width="131" class="tbody"><input type="radio" name="age" value="3"> 11 - 19 tahun</td> <td width="110" class="tbody"><input type="radio" name="age" value="4"> > 19 tahun</td> </tr>             <tr>               <td class="tbody"><input type="radio" name="jantina" value="m"> Male</td> <td class="tbody"><input type="radio" name="jantina" value="f"> Female</td>             </tr>             </table>                       <input type="submit" name="submit" value="Next"> </form> [/code]
  5. How to change the charset then?
  6. How do i repair a table that has this error #1105 - File 'C:\AppServ\mysql\share\charsets\?.conf' not found (Errcode: 22) I try to repair the table by using this sql 'Repair table mytablename' but it didn't work. I can't acces any data from this table to view in my page.
  7. I got this error everytime i load mypage Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... line .. the error is at the line '$myrow = mysql_fetch_array($result);' from this part [code] <?php $query= "SELECT * FROM jawapan WHERE kategori = '$tanda' AND idsimptom = '$id'"; $result = mysql_db_query($dbc,$query); $myrow = mysql_fetch_array($result); ?> [/code] Then i try to put '@'  in front of the error code, but the code returns nothing from the sql statement.
  8. ok then this is 'mysql_connect.php' [code] <?php define("DATABASE_HOST", "localhost"); define("DATABASE_USER", "root"); define("DATABASE_PASSWORD", ""); mysql_pconnect(DATABASE_HOST,DATABASE_USER, DATABASE_PASSWORD) or trigger_error(mysql_error(),E_USER_ERROR);; $dbc = "xpert"; ?> [/code] But somehow i don' think the problem comes from this code. Eneway....i appreciate it if you could find the solution.
  9. This is my coding regarding the error. It's quite long but i just put the part where the php coding started. [code] <?php include ('mysql_connect.php'); include ('papar_fungsi.php'); //$currentPage = $_SERVER["PHP_SELF"]; $age = $_GET["umur"]; session_name ('diagnos'); session_start(); if (!isset($_SESSION["diagnos"])) { $_SESSION["diagnos"] = NULL; } $maxRows_Recordset1 = 1; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) {   $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; if ( $age == 1 ){ $query_Recordset1 = "SELECT * FROM simptom WHERE kategori='$tanda' AND bayi='y' "; }else { $query_Recordset1 = "SELECT * FROM simptom WHERE kategori = '$tanda'"; } $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $id = $row_Recordset1['idsimptom']; if (isset($_GET['totalRows_Recordset1'])) {   $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else {   $all_Recordset1 = mysql_query($query_Recordset1);   $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; $queryString_Recordset1 = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) {   array_push($newParams, $param); }   }   if (count($newParams) != 0) { $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));   } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); $query= "SELECT * FROM jawapan WHERE kategori = '$tanda' AND idsimptom = '$id'"; $result = mysql_db_query($dbc,$query); $myrow = mysql_fetch_array($result) ?> [/code] The problem is, if the error 'no database select' happened, i couldn't view anything in my page. Kindly please help me. Tq.  :(
  10. hi... Why do i always get the error 'no database select' everytime i open a page that has sql statement in it. I have to view other page that has no sql statement before i could open the page.
×
×
  • 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.