1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Help Patulong naman po dito sa error na ito

Discussion in 'Coding, Programming' started by janehl1403, Apr 15, 2013.

  1. Sir pa-help naman po dito:
    nakahighligt po yung txtvalue at Sdata po:

    ERROR:
    Notice: Use of undefined constant txtvalue - assumed 'txtvalue' in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 63

    Notice: Undefined index: txtvalue in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 63

    Notice: Use of undefined constant Sdata - assumed 'Sdata' in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 64

    Notice: Undefined index: Sdata in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 64


    Code:

    <html>
    <head>
    <title> List of Species</title>
    <link href="style.css" type="text/css" rel="stylesheet">
    <script language="javascript">
    <!----
    function openW(fish_id)
    {
    aPopUp= window.open('viewList.php?fish_id='+fish_id,'viewL ist','menubar=no,toolbar=no,location=no,directorie s=no,status=no,scrollbars=yes,resizable=yes,copyhi story=no,width=760,height=600')
    aPopUp.focus()
    }
    -->
    </script>
    <style TYPE="text/css">
    <!--
    table {border-collapse: collapse;}
    .odd {background-color:teal}
    .even {background-color:teal}
    //-->
    </style>
    </head>


    <body class="blist">
    <center>
    <?php
    include ("config.php");
    $db = mysql_connect($dbhost,$dbuser,$dbpass);
    if (!$db)
    {
    die('Unable to connect' . mysql_error());
    }
    ?>
    <form method='get' action='<?php $PHP_SELF ?>'>
    <table border=2 cellpadding= 3 id='searcharea'>
    <tr>
    <td>Search by:<br/></td>
    <td>
    <select name = "Sdata" id="sel">
    <option value="`identification`.`sci_name`">Scientific Name</option>
    <option value="`identification`.`en_name`">Common Name</option>
    <option value="`identification`.`l_name`">Local Name</option>
    </select>
    <input type= text id="opt" name="txtvalue" size=20 value=''></td>
    <td align=left><input type=submit name=Ok value='Show List'></td>
    </tr>
    </table><br/>
    </form>

    <table border=1>
    <tr id='listlabel'>
    <td width=10px></td>
    <td width=50px>Class</td>
    <td width=50px>Order</td>
    <td width=50px>Family</td>
    <td width=100px>Scientific Name</td>
    <td width=100px>Common Name</td>
    <td width=100px>Local Name</td>
    <td width=10px></td>
    </tr>

    <?php
    $value1=$_GET[txtvalue];
    $value2=$_GET[Sdata];
    mysql_select_db($dbname,$db);
    if (isset($_GET['start'])) {
    $sql = "SELECT
    `identification`.`fish_id`,
    `identification`.`division`,
    `identification`.`order`,
    `identification`.`family`,
    `identification`.`sci_name`,
    `identification`.`author`,
    `identification`.`en_name`,
    `identification`.`l_name`,
    `division_list`.`division_name`,
    `family_list`.`family_name`,
    `order_list`.`order_name`
    FROM
    `identification`
    Inner Join `family_list` ON `family_list`.`family_code` = `identification`.`family`
    Inner Join `division_list` ON `division_list`.`division_code` = `identification`.`division`
    Inner Join `order_list` ON `order_list`.`order_code` = `identification`.`order`
    WHERE
    sci_name LIKE 'A%' ORDER BY `identification`.`sci_name` ASC";

    } else {
    $sql = "SELECT
    `identification`.`fish_id`,
    `identification`.`division`,
    `identification`.`order`,
    `identification`.`family`,
    `identification`.`sci_name`,
    `identification`.`author`,
    `identification`.`en_name`,
    `identification`.`l_name`,
    `division_list`.`division_name`,
    `family_list`.`family_name`,
    `order_list`.`order_name`
    FROM
    `identification`
    Inner Join `family_list` ON `family_list`.`family_code` = `identification`.`family`
    Inner Join `division_list` ON `division_list`.`division_code` = `identification`.`division`
    Inner Join `order_list` ON `order_list`.`order_code` = `identification`.`order`
    WHERE
    ".$value2." LIKE '%".$value1."%' ORDER BY `identification`.`fish_id` ASC";
    }
    $result = mysql_query($sql,$db);

    if($result){
    $counter = 0;


    while ($myrow = mysql_fetch_array($result)) {
    $counter++;
    (fmod ($counter,2))? $bg=odd: $bg=even;
    printf("<tr class=$bg>
    <td id='entry'>%s</td>
    <td id='entry'>%s</td>
    <td id='entry'>%s</td>
    <td id='entry'>%s</td>
    <td id='sci'>%s</td>
    <td id='entry'>%s</td>
    <td id='entry'>%s</td>
    <td id='ent'><a href=\"javascript: openW('$myrow[fish_id]')\"><input type='image' name=mybutton src='images/view.png' title='view'/>
    </a>
    </td></tr>",$counter, $myrow[division_name], $myrow[order_name], $myrow[family_name], $myrow[sci_name], $myrow[en_name], $myrow[l_name]);
    }

    echo "</table>\n";
    }
    ?>
    </center>
    </body>
    </html>
     
  2. hindi ako marunong ng php pero tingin ko.. ala ka yata nailagay na value ng data or text or di mo din dnclare as constant sya. yun po. yun tingin ko. :) if mali po. pasensya.. di ako mglng sa web base. ehhee
     
  3. undefined which means gumamit ka ng isset sa code mo.
     
  4. paturo php boss. wahaha XD
     
  5. kunti lang alam ko jan e pero try ko sya tulungan.
     
    cyberkram likes this.
  6. ewan ko nga po kung ano nangyari jan pero nagrun naman yan before,. ngayon na tinry ko ulit nagka-error na,. yung txtvalue at Sdata nasa form naman yan eh bali ginawan ko po sila ng variables for easy call,. Patulong naman jan,,.sumasakit na ulo ko,.:(
     
  7. janehl paki attach lahat ng files na ginagamit mo dito salamat.
     
  8. sir wawen./d po kasya,.nakacompressed file po 3Mb tapos ang limit po dito uploading is 2MB lang po,.pwede MF ko nalng??

    D lang po pala yan yung error pati po sa ibang PHP file po,.Hindi ko po alam kung bakit nagka-error po ito,.
     
  9. cge cge MF nalang send link sa conversation nalang :)
     
  10. Ito na po link sir:
    Nasa loob po yung database "MyDatabase.sql" po ang filename.
    may database password po yan paki-delete nalng po,.TY

    Please or Register to view links
     
  11. inaassume mo kasi na everytime na magrrun yung script mo na yan, may value na malalagay sa variable na nag error. which is not acceptable sa debugger.
     
  12. talagang mag uundefined po yan..kc wala pang value ang txtdata at sdata, pag ka run. may value lang yan dba pag click ng button?.. mas magandang gawin ay. e check mo kung nka defined ba using *isset* .. GET po yan ei.. makikita ang value s url kaya malalaman mo kung may txtdata at sdata var.
     
  13. JhoLou

    JhoLou Eternal Poster Established

    VB? o PHP? haha naguluhan ako bro
     
  14. PHP yan bro.
     
  15. JhoLou

    JhoLou Eternal Poster Established

    Ay, di ko pa yan na tutunan wala pa ako maitutulong.
     
Tags / Keywords: