Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. for starters, change these lines

    <?php 
    $row= mysql_fetch_array($rs);
    ?>
    
    
    
    <table border="1" summary="Customer Details">
    <tr>
    <th>cID</th>
    <th>Order number</th>
    <th>Order Date</th>
    <th>Shipped</th>
    </tr>
    <?php
    if ($custid == $row)  { ?>
    <tr>
    <td><?php echo $row["customerID";] ?></td>
    <td><?php echo $row["orderNumber"]; ?></td>
    <td><?php echo $row["orderDate"]; ?></td>
    <td><?php echo $row["shipped"]; ?></td>
    
    </tr>
    <?php }
    mysql_close($conn); ?>
    </table></body></html>

    also, not sure why you are setting your post id equal to mysql_fetch_array()

  2. you could try debugging your queries...

    $getNEWid2 = mysql_query("SELECT ID FROM ".$conf['tbl']['users']." ORDER BY ID DESC LIMIT 1 ") or die(mysql_error());	
    WHILE ($NEWid2 = mysql_fetch_array($getNEWid2)){
    $send = mysql_query("SELECT name,user,email from ".$conf['tbl']['users']." WHERE ID=$NEWid2[iD]") or die(mysql_error());
       WHILE($newsiteuser = mysql_fetch_array($send)) {
    //emails sent here//
    }}

  3. try to keep your function var consistent with your post var. So if your post var is $name, then your function var will be $name

    class validate
    {
    
    function check_input($name)
    {
        $data = trim($name);
        $data = stripslashes($name);
        $data = htmlspecialchars($name);
        return $name;
    }
    
    }

  4. like i said, look at your insert statement, the query doesnt now where to insert the submitted data.

     

    $sql = "INSERT INTO info  VALUES (null, '$title' , '$body')";

     

    should be

     

    $sql = "INSERT INTO info (title,body) VALUES ('$title' , '$body')";

     

    also need to add a " = " to this line

    <label for="title">Title:</label>

    <input type="text" name"title" id="title" />

    labrat, you do not need to specify where to put the values as long as the values match with the fields, if you have an auto-incrementing field that you are not inserting a value into, you will need to put empty quotations for that field in your insert clause...eminempk, where is the script that is calling the functions that you created?

  5. And also, put MySQL field names in backquote operators, so that it never conflicts with MySQL reserve word. E.g. "password" is a MySQL reserve word. Try this:

     

    $user = mysql_real_escape_string($_POST['user_name']);
    $pass = mysql_real_escape_string($_POST['password']);
    $query = "SELECT * FROM `users` WHERE `user_name` = '$user' AND `password` = 'pass'";
    $user_name_check = mysql_query($query);
    

     

    Thanks!

    actually, "password" is not a mysql reserved word...however always placing backticks around you field names will eliminate the risk of triggering an error due to using a mysql reserved word

×
×
  • 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.