User Profile

Collapse

Profile Sidebar

Collapse
Zack2008
Zack2008
Last Activity: Nov 9 '08, 03:06 PM
Joined: Aug 6 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Zack2008
    replied to How to run this SQL query
    It shows an error if I move the bracket to after $to

    Parse error: syntax error, unexpected ';' in /home/updates/public_html/matches/consecutivedeta il.php on line 39

    39 is [PHP]ORDER BY Date DESC"[/PHP] so don't know where unexpected ';' is!?

    I'll leave it as ORDER BY Date DESC") while it's working though!

    Thanks for your help :)

    Edit: Maybe it's something to do with...
    See more | Go to post
    Last edited by Zack2008; Oct 23 '08, 10:33 AM. Reason: PHP4

    Leave a comment:


  • Zack2008
    replied to How to run this SQL query
    Thanks, that final example works. I understand why that is now, I thought it would work if I put the OR part first, will have to remember the brackets in future then!

    Nope, I don’t know what these CONVERT etc are for. I had problems getting code to work before so I went into PHPMyAdmin and ran the same and it worked, so I used the "create PHP code" option and pasted this into the PHP file, this included all the USING etc...
    See more | Go to post

    Leave a comment:


  • Zack2008
    replied to How to run this SQL query
    Display the matches from the database, filtered by something different on each page. Sometimes it's just home team, sometimes just away, sometimes just competition. This page is where the home or away team are involved in the competition between certain dates. If I only pick home then it works but away matches are not included. The date orderby is so the latest match is at the top of the table at the end

    Thanks
    Zack:)
    See more | Go to post

    Leave a comment:


  • Zack2008
    started a topic How to run this SQL query

    How to run this SQL query

    Hi, I am trying to run the following query, but it's only displaying the records where `home` is $team, but it's not displaying the records where `away` is $team

    Here is my code

    [PHP]$data = mysql_query("SE LECT DATE_FORMAT(Dat e,'%d/%m/%Y') AS UKDate , TIME_FORMAT(Tim e,'%H:%i') AS TimeNew , `Home` , `Away` , `Final` , `Status` , `FT` , `Att` , `ID` FROM matches WHERE `Away` OR `Home` LIKE CONVERT( _utf8 '$team'...
    See more | Go to post

  • Zack2008
    replied to Displaying SQL Results
    Thanks, understand that but have never really understood other examples so have just messed about until it's worked!

    Thanks it's all working now, just one other thing but I will start a new topic when I get round to doing it, bit too much to tag onto this topic
    See more | Go to post

    Leave a comment:


  • Zack2008
    replied to Displaying SQL Results
    Thanks I missed that with line 15 that works now, just line 17 causing problems. It was partly what I copied off here. I am using dreamweaver trail which is useful for highlighting when things go wrong (unless Cpanel where it just looks like one big mess), but I can't get 17 to work, have tried lots of different ways and just get

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/updates/public_html/matches/grounds.php...
    See more | Go to post

    Leave a comment:


  • Zack2008
    replied to Displaying SQL Results
    Thanks, I thought I was doing this right, but obviously not!

    I'm getting "Parse error: syntax error, unexpected T_VARIABLE in /home/updates/public_html/matches/grounds.php on line 16"

    If I make the "" into just " then line 15 has an error instead!

    Code:
    <div align=\"left\"><table border=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"><tr><td>Venue</td><td>Times
    ...
    See more | Go to post

    Leave a comment:


  • Zack2008
    replied to Displaying SQL Results
    Thanks, I got it working anyway in the end, part of it didn't copy.

    This is part of my code
    Code:
    if (!$result) {
        $message  = 'Invalid query: ' . mysql_error() . "\n";
        $message .= 'Whole query: ' . $query;
        die($message);
    }
    
    while ($row = mysql_fetch_assoc($result)) {
    echo "<tr><td> ".$row['venue'] . "</td>";
    ...
    See more | Go to post

    Leave a comment:


  • Zack2008
    started a topic Displaying SQL Results

    Displaying SQL Results

    Hi I have made a database with all different things (venue, team names etc), the team names display fine, but I am using different code for venues (counting) and these just won't display at all, I am really new to SQL so don't know what to do to fix it!

    The code for getting the SQL is

    $sql = 'select venue,count(ven ue) as frequency from matches group by venue limit 300';

    which works fine in phpMyAdmin and...
    See more | Go to post
No activity results to display
Show More
Working...