Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Scotland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Totally Flummoxed ...

    Hello everyone,

    I'm going (more) insane... I'm no developer, more of a designer, but I can manage JavaScript and Actionscript, so thought I'd try and get my head around PHP for a project I'm working on. After several days of trawling google and your sticky threads here, I'm even more confused.

    I am working on a wedding website which allows visitors to search by a particular wedding style. The results come back with an image, photographer name and venue. I've set all of these up on a mySQL database. I need it to bring back records from a particular column with a value of 1, showing the elements I described above. I then want to link from the image to a detail page which isn't database driven, so it's a simple link to a url.

    I think the problem is that I'm working with old script from a form search... I decided to start with where I'd like the results from the database to go and work backwards, analysing what links to what in the code. So I have a div with what I think is php corresponding to field names in my database:

    PHP Code:
      <?php
        
    <div id="details"><a href="http://rlwtest.co.uk/images/$txtURL"><img src="<?=$pathPictureFileName?>" width="100" alt="<?=$fldName?>" title="<?=$fldName?>" /></a>
        <
    p><?=$fldVenue?></p>
      <p><?=$fldPhotographer?></p>
      </div>
      ?>
    I'm now trying to look at a huge piece of php which I've tailored to this:

    PHP Code:
        // fetch the row data   
                                
    $sql->Fetch($i);
                                
    $fldPicture_Id $sql->data[1];
                                
    $fldName $sql->data[2];
                                
    $txtURL $sql->data[3];
                                
    $fldVenue $sql->data[4];
                                
    $fldPhotographer $sql->data[5]; 
    PHP Code:
      <?php
        
    <div id="details"><a href="http://rlwtest.co.uk/images/$txtURL"><img src="<?=$pathPictureFileName?>" width="165" alt="<?=$fldName?>" title="<?=$fldName?>" /></a>
        <
    p><?=$fldVenue?></p>
      <p><?=$fldPhotographer?></p>
      </div>
      ?>
    Now I'm lost ... I know there's more php needed, and I thought I could code that from the tutorials, but I'm stuck. I know how I'd do it as a recordset, but past designers of the site have used php.

    Not looking for someone to give me a complete solution, just some pointers on what to do (barr finding a developer somewhere who can and paying them!) ... thanks muchly, Lins

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    thats illegal in php
    PHP Code:
    <?php echo "<div id=\"details\"><a href=\"http://rlwtest.co.uk/images/$txtURL\"><img src=\"$pathPictureFileName\" width=\"165\" alt=\"$fldName\" title=\"$fldName\" /></a>
        <p>$fldVenue</p>
      <p>fldPhotographer</p>
      </div> "
    ;
    ?> 
    //or try multi-lining it into more than one echo statement.

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Scotland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ahhh cool,

    I remember reading about multilining echo statements,

    thanks for that, will change that bit


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •