Jump to content

iandotcom

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by iandotcom

  1. I'm looping the results of a MySQL query which displays the 9 most recent records in the table.

     

    When I'm printing it though, I need to change the output though for every third iteration in the loop, to change the HTML that is outputted when it is printed. Its to keep the design looking correctly.

     

    How would I go about this?

     

    Heres the code if your a bit stumped on what I mean:

     

    <?php
    $RecentQuery = mysql_query("SELECT * FROM `blog` LIMIT 0 , 9");
    while($Recent = mysql_fetch_array($RecentQuery, MYSQL_ASSOC)){
    ?>
    
    // Outputted HTML code goes here
    
    <?php } ?>
    
    

     

    Cheers

     

    -- Ian.

  2. Hey,

     

    I'm trying to set up a loop that writes the code for submitting a form, by using the variables from an array.

     

    Heres my two arrays:

     

    $FormValues = array("Firstname", "Lastname", "month", "date", "year", "Email", "URI", "Street", "City", "ZIP", "homephone", "workphone", "cellphone", "image");
    
    $DBValues = array("firstname", "lastname", "DOBmonth", "DOBdate", "DOByear", "email", "URI", "street", "city", "zip", "homephone", "workphone", "cellphone", "image");

     

    What I want to do is to be able to use these arrays in a loop, so it writes the same code each time, but writes in the different variable on each go.

     

    Can anyone help me out on this, thanks very much :D

     

    Ian

     

  3. Same result :(

     

    Heres the error message when it fails:

     

    Warning: include(../iandotcom/comments/comments.php?id=1) [function.include]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\iandotcom\about\index.php on line 79

     

    Warning: include() [function.include]: Failed opening '../iandotcom/comments/comments.php?id=1' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\iandotcom\about\index.php on line 79

  4. Hey,

     

    I made a commenting app for my website, and I'm having problems with the include for it to be embedded on its parent page.

     

    	<?php
    
    	include ("../iandotcom/comments/comments.php?id=1");		
    
    	?>
    
    

     

    Its probably really simple, I'm quite new to PHP. I'm running this off my localhost, so thats the root.

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