Jump to content

hotmert

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Posts posted by hotmert

  1. Hmm thanks for the reply.  Dont tell but i used phpmaker5 to do all the work then modified slightly from there. Works fine on localhost..do you think some of the php is still looking to localhost rather than the server.  There is loads of php pages

  2. images are uploaded to a directory and the sql database contains the filename. I added 'url' field and am trying to link the two

     

    I have used on of the posts to help me adapt some script however I'm not sure I have the syntax right.  The image in DW live view looks ok and I get the link finger ok but when previewed in browser the image is not shown at all or any link.

     

    Any ideas

     

    <? echo !empty($row['pic']) ?  "<a href=\"{$row['url']}\" <img src=\"js/images/{$row['pic']}\">" : ''; ?>
    

     

    it echos out to a table

     

    Mike

  3. Just tried that and it did the same thing, however I tried this and at the moment it seems to work.  Just added ORDER BY date before the LIMIT 1

    
    $sql = "(SELECT date, time, event, bands FROM listings WHERE date = CURDATE() ORDER BY date LIMIT 1) UNION (SELECT date, time, event, bands FROM listings WHERE date > CURDATE()ORDER BY date LIMIT 1) "
    
    

  4. Ok so, I have a database with loads of upcoming events. The events hay and 'id' key byt NOT inputted in sequence, but are sorted by date for output to a listing page. I am attempting to show a snippit from that listing and show on my homepage i.e. now and next events.

     

    It kinda worked but now it's not. It seems to show either no next event or the next 'id' event.  The first time i wrote and tried the code it worked but now two days later is gone a bit wrong.

     

    This is what I have going at the moment to get the now and next onto homepage

    
    $sql = "(SELECT date, time, event, bands FROM listings WHERE date = CURDATE() LIMIT 1 ) UNION (SELECT date, time, event, bands FROM listings WHERE date > CURDATE() LIMIT 1 )" or die(mysql_error());
    
    

     

    https://www.thefiddlerselbow.co.uk

     

    https://thefiddlerselbow.co.uk/gig_guide.php

     

    I just noticed at 05:57 GMT that the next event has appeared but its the next id event not date event...Obviously it's using US time....humm

     

    So I guess help the code works but a tweak on the code to get it to show the now and next events on date not id would help.

     

    Thanks for looking, these forums are so good when your head is full no ideas.

  5. SQL database with 'id', 'date', 'event', 'bands', 'info', 'price'.  Server side I added 'pic' after 'info'. New data added to the database comes out ok but what was already in there the price symbol has changed to the black diamond.

     

    I have tried deleting the 'price' field content for one record, saving the re-writing the price server side and through my form but no change??

     

    This is the out put page, if you look, choose jun

     

    http://www.thefiddlerselbow.co.uk/gig_guide.php

     

    No changes have been made to the charset...like I said it worked before, so why not now.  I have looked at the charset for utf-8 and i have a lot of choices in the list but they all have an option after ie utf-8-general, utf-8-universal, utf-8-russian etc...no english there.

  6. All I did was inset a field to my database, and now, all my price symbols ie £ have been replaced by �.  It was fine before so why has it changed, and what can I do to stop it happening again

     

    grrrrrr!

  7. I have a gig listing database with a fields 'date', 'time', 'event, 'bands', 'info', 'pic', 'price'.  I have got the display looking good and out putting nicely. But it wont be truly complete until I can get the 'pic' to display.

     

    'pic' will ultimately only ever be one per record and appx 130px x 130px so can be a blob (ooh) or point to a file. See img incl, 'pic' will go to the left of 'price'...border is just for definition and will not be in the final version.

     

    All the examples assume the images are in a separate database and just position somewhere so I have found it difficult to find my way through all of these.

     

    Plus I have used phpmyedit to create my admin form and will try to create a means of uploading eventually.

     

    So help on image display would be very much appreciated.

     

    Mike

     

    //code

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>View Details</title>
    
    <style type="text/css">
    .table-holder #even {
       padding: 5px;
       margin-bottom: 5px;
       font-family: Arial;   
    }
    
    .table-holder #even tr #price-colour, .table-holder #odd tr #price-colour {
    
           color: #D94D26;
           font-size: 20px;
           
    }
    .table-holder #even tr #bands-colour, .table-holder #odd tr #bands-colour {
    
           color: #FFFFFF;
           font-size: 20px;
           
    }
    .table-holder #even tr #event-colour, .table-holder #odd tr #event-colour {
    
           color: #D94D26;
           font-size: 20px;
           font-style:italic;
    }
    .table-holder #even tr #info-colour, .table-holder #odd tr #info-colour {
    
           color: #999999;
           font-size: 16px;
    }
    .table-holder #even {
    
           background-color: #333333;
           padding: 5px;
           margin-bottom: 5px;
    }
    .table-holder #details2 {
           background-color: #333333;
           padding: 5px;
           margin-bottom: 5px;
    }
    .table-holder #even tr td .title {
    
           color: #FF9;
           margin-right: 5px;
           font-size: 16px;
           
    }
    .table-holder #odd tr {
       background-color: #000000;
       font-family: Arial;
    }
    .table-holder #odd {
           background-color: #000000;
    
           padding: 5px;
           margin-bottom: 5px;
    }
    .table-holder #odd {
           background-color: #000000;
    
           padding: 5px;
           margin-bottom: 5px;
    }
    </style>
    </head>
    <body>
    
    <form method = "POST" align="center">
    <select name ="month">
    <option>PICK A MONTH</option>
    <option value="1">Jan</option>
    <option value="2">Feb</option>
    <option value="3">Mar</option>
    <option value="4">Apr</option>
    <option value="5">May</option>
    <option value="6">Jun</option>
    <option value="7">Jul</option>
    <option value="8">Aug</option>
    <option value="9">Sept</option>
    <option value="10">Oct</option>
    <option value="11">Nov</option>
    <option value="12">Dec</option>
    <input type="submit" value="Rock on ! !"
    </select>
    </form>
    
    
    <?php
    
    #connect to MySQL
    $link = mysql_connect('localhost', 'root', 'root'); 
    if (!$link) { 
        die('Could not connect: ' . mysql_error()); 
    }
    
    #select the database
    $link = @mysql_select_db("gig_list1") or die("Could not select database");
    
    //call user choice
    $user_choy =$_REQUEST['month'];
    echo "User selected <br>"; 
    
    
    #create the SQL query which will output gig for month selected
    
    
    $sql = "SELECT * FROM `listings` WHERE YEAR(`date`) = YEAR(NOW()) AND MONTH(`date`) = ('$user_choy') ORDER BY date" or die(mysql_error());
    
    #execute the query
    $link = @mysql_query($sql) or die("Could not execute SQL query");
    ?>
    <div class="table-holder">
        <table width="100%" border="0" id="details">
    <?
    #loop through all records
    $counter = 0;
    while ($row = mysql_fetch_array($link)) 
    {
       $rowclass = ($counter % 2 == 0) ? 'style="background-color: #333333"' : '';
       $tableclass = ($counter % 2 == 0) ? 'even' : 'odd';
       ?>
       <div class="table-holder">
       <table width="100%" border="1" padding="5" table height="100"id="<?=$tableclass;?>">
    
       <tr <?=$rowclass;?>>
           <td rowspan="3" valign="top "width="100" id="event-colour" align="left" style="border-right:2px solid black"><? echo date("D j", strtotime( $row["date"])); ?></td>
          
           <td width="7%" valign="top " id="event-colour" align="left"><? echo $row["time"]; ?></td>
          
           <td align="left" valign="top " align="left" id="event-colour"><? echo $row["event"]; ?></td>
    
          <td rowspan="3" width="12%"><? echo $row["pic"]; ?></td>
    
          <td width="10%" valign="top "margin="10px"style="border-left:2px solid black" rowspan="3" align="center" id="price-colour"><? echo $row["price"]; ?></td>
          
       </tr>
       <tr <?=$rowclass;?>>
           <td colspan="2" id="bands-colour"> <? echo $row["bands"]; ?></td>
          
       </tr>
       
       <tr <?=$rowclass;?>>
           <td colspan="2" id="info-colour"><? echo $row["info"]; ?></td>
          
       </tr>
       </table>
       </div>
       <?
       $counter++;
    }
    ?>
        </table>
       
    </div>
    
    
    </body>
    </html>
    

     

    MOD EDIT: code tags added.

     

    [attachment deleted by admin]

  8. Yeah I actually sorted that one myself, must be learning!  Not seen the oop form before although I have seen similar "not working" type stuff (!isset).

     

    Again, I see that wonderful display of script and I think to myself where does that fit in to what I have already.  My 'customer' wants people to see 'whats on' for each month he has data for.  So I gotta think of a clever way to do that.

     

    Display current month, I now see that thats no good if you want to see whats on next month. And fixing the month ie MONTH('date') = 7 would mean a new web page for every month.  That's what I do now!

     

    I think I need to offer the viewer a choice and use that in the query??

  9. Thanks for everyones help on this. 

     

    I have not been able to 'make it work', with the code I already have, as I don't know where to put it and I'm never quite sure which bits to replace.  Obvious ones like 'my table name' are easy.  I tried replacing the SELECT statement I already have with the one suggested. xyph: your statement sort of worked I guess but gave zero results.

     

    I have to admit I thought the advice might require me to have more knowledge than I do, as some assumptions are being made, and rightly so.

     

    Sadly, I think I'm shooting above my weight here and should bug out.

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