Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Installing WordPress
    In reply to: Parse Error?

    hi
    can anybody will help me?

    gettin error parse error, unexpected $ on last line

    Forum: Installing WordPress
    In reply to: Parse Error?

    <?php

    $flag=true;
    $link=mysql_connect(“localhost”, “ajit”, “ajit”)
    or die (“Could not connect to MySQL”);

    mysql_select_db (“ajit”)
    or die (“Could not select database”);
    $submitSearch=$_POST[‘submit’];
    $name=$_POST[‘search’];
    $add=$_POST[‘add’];
    if(isset($link))
    { if(isset($submitSearch))
    {
    if(isset($name))
    {

    $searchResult=mysql_query(‘select * from personInfo where name LIKE "$name" ORDER BY date DESC;')
    or die ("Query failed");
    if(mysql_num_rows($searchResult)>0 ){
    display_table($searchResult);
    }
    else{
    echo"no such row obtained";
    }
    }
    else{echo"Give the name of person you want to search";}

    }
    elseif(isset($add))
    {

    Header("Location: https://192.168.0.10/~ajit/infoform.php&quot;);
    }

    else{
    $result = mysql_query('select * from personInfo order BY date DESC;')
    or die ("Query failed");
    $num=mysql_num_rows($result);

    display_table($result);
    }

    }

    else{
    echo"could not connect to the database";

    }

    /* THIS TABLE WILL DISPLAY ALL FETCHED ROWS FROM TABLE + ADD EDIT LINK+
    +E-MAIL LINK*/

    function display_table($result)
    {
    if(isset($result))
    {
    $subject="REMINDER ABOUT WORK";
    $messege="Hello sir/madam";
    print "<table border=1><br>";
    $temp=0;
    echo"<tr>";
    for($temp=0;$temp<18;$temp++)
    {
    echo"<td>";
    $fieldname= mysql_field_name($result, $temp);
    echo"$fieldname";
    echo"</td>";
    }
    echo"</tr>";

    while ($line = mysql_fetch_array($result))
    {
    echo "<tr>";

    foreach ($line as $key=>$value)
    {
    $temp=0;
    if ((mysql_field_name($result, $temp)=="emailid"))
    {
    echo "<td>";
    @mail($value, $subject, $message );

    //echo'<a href="mailto:$value?subject="Feedback">E-MAIL</a>';
    echo "</td>";
    }

    else{
    echo "<td>";
    echo"$value";
    echo"</td>";
    }

    $row = mysql_fetch_array($result,MYSQL_NUM);
    $id=$row[0];
    //echo”<td align=\”center\” bgcolor=\”#5647A1\” onclick=\”window.location.href=’editform.php’;\”> EDIT </td>”;

    echo”<td></td>”;

    $temp++;
    echo “</tr>”;
    }
    print “</table><br>”;
    }
    }
    else{
    echo”NO RESULTS FOUND”;

    }
    }

    ?>

    <html>
    <head>
    <title>PERSON INFORMATION</title>
    </head>
    <body>

    <form method=”post” >
    <input type=”text” name=”search” <br>
    <label> SEARCH PERSON NAME</label>
    <input type=”submit” name=”submit” value=”SEARCH”>
    <input type=”submit” name=”add” value=”ADD_NEW_RECORD”>
    </form>
    </body>
    </html>

Viewing 2 replies - 1 through 2 (of 2 total)