Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. try:

     <ul>
                <?php $result = mysql_query("SELECT * FROM pages INNER JOIN parent_pages ON pages.parentID=parent_pages.ID WHERE pages.parentID=parent_pages.ID");
                while ($row = mysql_fetch_assoc($result)):?>
                <li class="mainnav"><a rel='nofollow' href='view.php?id=<?php print $row['ID'];?>'><?php print $row['Name'];?></a>
                    <ul>
                        <li class="subnav"><a rel='nofollow' class="sublink_nav" href='viewpage.php?pageid=<?php echo $row['pageID'];?>'><?php print $row['pageName'];?></a></li>
                    </ul>
                </li>
                <?php endwhile;?>
                <?php $result2 = mysql_query("SELECT * FROM parent_pages WHERE pageID='0'");
                while ($row2 = mysql_fetch_assoc($result2)):?>
                <li class="mainnav"><a rel='nofollow' href='view.php?id=<?php print $row2['ID'];?>'><?php print $row2['Name'];?></a></li>
                <?php endwhile;?>
                </ul>

  2. there is a bult in function in mysql that allows you to pass in an array as a parameter:

    $array = (1,2,3,4);
    SELECT *, CONCAT(locations.zip_code, ' ', locations.city) as location from locations, locations_associations where locations.zip_code = locations_associations.zip_code AND client_id IN ($array);
    

  3. what is the data type for your dob field? If you used a date type then you can just do it all in one query

    SELECT * FROM detail WHERE dob = CURDATE()

     

    and if you use a datetime datatype:

    SELECT * FROM detail WHERE DATE(dob) = CURDATE()

     

    and if you wanted to get everyone who had a birthday tomorrow:

    SELECT * FROM detail WHERE DATE(dob) = DATE_ADD(CURDATE(), INTERVAL 1 DAY);

     

    etc.....................

  4. The exception is telling you that you have a syntax error in your query. This could be due to an escape character being passed into the user variable. Try doing:

    $query = "SELECT * FROM `users` WHERE `username` = '".$user."' AND `password` = '".$pw."'";

    Also try and echo out

    $query

    to see what the query looks like

  5. Try sending a static email to test if the actual email functionality is working

    mail('youremailaddress@somewhere','test subject','test message');

     

    If that dosent send then you need to ensure your web hosting has email functionality enabled. Otherwise you need to echo out each of the variables. Your 'from' is a header parameter and should be in the correct format 'From : me@emailaddress.com'

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