Jump to content

newb

Members
  • Posts

    454
  • Joined

  • Last visited

Everything posted by newb

  1. [!--quoteo(post=385463:date=Jun 18 2006, 07:22 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 18 2006, 07:22 PM) [snapback]385463[/snapback][/div][div class=\'quotemain\'][!--quotec--] Then you need to rethink your database design. Look into database normalization techniques. [/quote] what do u mean????
  2. im querying two tables because they both contain fullsize images i need to echo on that page when the url is view.php?id=1, 2, etc... the two tables have the same exact field names too. they just have different data in the fields. table1 contains id's 1-17 and table2 contains id's 18-49.
  3. [code] <?php     include "../inc/connect.php";     $query = "SELECT fullsize FROM table1,table2 WHERE id='%'";     $result = mysql_query( $query );          if ( !$result ) {            die($query.'<br />'.mysql_error());     }                              // Build Table     while( $row = mysql_fetch_assoc( $result ) ) {                                   echo "<br /><br />$row[fullsize]";               }                         ?> [/code] thats the code, what i want it to do is echo the fullsize of the image to the page when the url is view.php?id=1 or id=2 or id=3, etc... the data thats in the fullsize field is this: [code] <img border='0' src='http://mysite.com/image.jpg'> [/code] can anyone help me? please i been trying to figure this out for a long time kthanks.
  4. ah ok. [code]    echo '<a href="view.php?id=' . $row['id'] . '">' . $row['thumb'] . '<br /></a>';[/code] that got me what i wanted, thanks alot.
  5. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] are you saying that if you do this: echo $row['link']; it spits out this? "view.php?id=$id" ??[/quote] yes. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] i'm gonna go on a hunch and tell you to put the $id = $row['id'] before the echo instead of after it. but that's just a hunch, cuz i can't see why on earth you would setup your db the way i kinda think you set it up...[/quote] ill try that thankxz.
  6. [code]<?php $query = "SELECT * FROM `thumbnails` ORDER BY title ASC"; $result = mysql_query( $query );      if ( !$result ) { die($query.'<br />'.mysql_error()); while( $row = mysql_fetch_assoc( $result ) ) { echo '<a href="' . $row['link'] . '">' .$row['thumb'].'<br /></a>; $id = $row['id']; ?> [/code] i want it to generate [a href=\"http://mysite.com/view.php?id=1\" target=\"_blank\"]http://mysite.com/view.php?id=1[/a] for example but instead it generates [a href=\"http://mysite.com/view.php?id=$id\" target=\"_blank\"]http://mysite.com/view.php?id=$id[/a] btw, data in the row link is "view.php?id=$id"
  7. newb

    error

    yeah works, thanks ! :D
  8. newb

    error

    ah, i tried that, but then i got the exact same error as well.
  9. newb

    error

    i see. well i ran into another error. its different. [code]     echo "' . $row['name'] . '"             <br>             <table border='0' width='100%' id='table1'>                 <tr>"; [/code] it generated this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in xx/x/xxx/x/xxx on line 12 can anyone help fix pleaseeee
  10. newb

    error

    worked, thanks. btw, how do you know where the quotes go and how to set em up properly?
  11. newb

    error

    echo <a href=\"$row['link'].'\">$row['thumb'].'</a>; gives me Parse error: syntax error, unexpected '<', expecting ',' or ';' in /xxx/xxx/xx/xx/xx/thumbnail.php on line 23 any idea how to fix
  12. what's the difference of using it with the <?php include() ?> command? advantages/disadvantages? the only one i know of is with .inc file you can see the raw info if u put it in the browser and .php file you cant.
  13. Nope, I'm basically trying to figure out how to print the data on the page without having to copy and paste all that code over and over and modifying it (thumb3, thumb4, thumb5, etc...). It's enough that I have to insert it all in the SQL db.
  14. [code]<?php include "../inc/connect.php"; $result = mysql_query("SELECT id, title, artist, thumb FROM pictures WHERE id='1'"); $result2 = mysql_query("SELECT id, title, artist, thumb FROM pictures WHERE id='2'") or die(mysql_error());   while($row = mysql_fetch_array( $result )) { $thumb = $row['thumb']; $title = $row['title']; $artist = $row['artist']; while($row = mysql_fetch_array( $result2 )) { $thumb2 = $row['thumb']; $title2 = $row['title']; $artist2 = $row['artist']; } echo "<p align='left'><font face='Arial'><b>My Thumbnails</b></font><br> <br></p> <table border='0' width='100%' id='table1'>     <tr>         <td width='33%' valign='top' height='65'>         $thumb<br>         Title: $title<br>         Artist(s): $artist         </td>         <td width='33%' valign='top' height='65'>         $thumb2<br>         Title: $title2<br>         Artist(s): $artist2 [/code] This code works fine. The problem is, I dont wan't to keep copying and pasting, adding repetitive code to the file. I was hoping there was a way to avoid doing this. It would save me alot of time and work. I just want to grab the data from the database. Anyone think they can help me with this? If so let me know, thanks.
×
×
  • 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.