Jump to content

leonthelion

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

leonthelion's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. like this result? this is an echo of the query SELECT ebc_books.title, ebc_book_reviews.* FROM ebc_books JOIN ebc_book_reviews ON ebc_books.isbn=ebc_book_reviews.isbn WHERE ebc_books.isbn = '131166'
  2. I'll try and fix the security hole once it is up and running.... I'm getting mildly closer and distant at the same time. There is one more echo command to try and help... if you think this may be better? [code]<?php require_once('dbconnections/ebc.php'); ?> <?php mysql_select_db($database_ebc, $ebc); $isbn = $_GET['isbn']; echo $isbn; //for testing $query_Recordset1 = "SELECT ebc_books.title, ebc_book_reviews.* FROM ebc_books LEFT JOIN ebc_book_reviews ON ebc_books.isbn=ebc_book_reviews.isbn WHERE ebc_books.isbn = '$isbn'"; $Recordset1 = mysql_query($query_Recordset1, $ebc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <title>reviews.php - almost working</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="5">   <tr>     <td>isbn</td>     <td>title</td>     <td>reviewer</td>     <td>reviewer country </td>     <td>review</td>     <td>rating</td>     <td>visible</td>   </tr>   <?php while($row_RecordSet1 = mysql_fetch_assoc($Recordset1)){   echo "<tr>\n"       ."<td>".$row_Recordset1['isbn']."</td>\n"       ."<td>".$row_Recordset1['title']."</td>\n"       ."<td>".$row_Recordset1['reviewer']."</td>\n"       ."<td>&nbsp;</td>\n"       ."<td>".$row_Recordset1['review']."</td>\n"       ."<td>".$row_Recordset1['rating']."</td>\n"       ."<td>".$row_Recordset1['visible']."</td>\n" ."</tr>\n"; } ?> </table> <p> </p> </body> </html> <?php echo $query_Recordset1; //testing mysql_free_result($Recordset1); ?>[/code]
  3. Thanks onlyican, that got the data outputting to the screen, but still not quite right, no matter which isbn is passed, eg: http://www.experiencebaja.com/reviews.php?isbn=546546 I'm getting 3 rows of the same results, and the isbn returned from the tables isn't matching what comes from the $_GET, as you can check with the echo statement. here is the code again: [code]<?php require_once('dbconnection/ebc.php'); ?> <?php mysql_select_db($database_ebc, $ebc); $isbn = $_GET['isbn']; echo $isbn; //for testing $query_Recordset1 = "SELECT ebc_books.title, ebc_book_reviews.* FROM ebc_books, ebc_book_reviews WHERE ebc_books.isbn = '$isbn' "; $Recordset1 = mysql_query($query_Recordset1, $ebc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); //$totalRows_Recordset1 = mysql_num_rows($Recordset1); don't need on this page ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <title>reviews.php - almost working</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="5">   <tr>     <td>isbn</td>     <td>title</td>     <td>reviewer</td>     <td>reviewer country </td>     <td>review</td>     <td>rating</td>     <td>visible</td>   </tr>   <?php while($row_RecordSet1 = mysql_fetch_assoc($Recordset1)){   echo "<tr>\n"       ."<td>".$row_Recordset1['isbn']."</td>\n"       ."<td>".$row_Recordset1['title']."</td>\n"       ."<td>".$row_Recordset1['reviewer']."</td>\n"       ."<td>&nbsp;</td>\n"       ."<td>".$row_Recordset1['review']."</td>\n"       ."<td>".$row_Recordset1['rating']."</td>\n"       ."<td>".$row_Recordset1['visible']."</td>\n" ."</tr>\n"; } ?> </table> </body> </html> <?php mysql_free_result($Recordset1); ?>[/code] Also, you mentioned I should be doing something to the $_GET variable when it comes in, is it a security concern?
  4. sorry, no good yet... with no variable passed, it now shows nothing, or with a variable, it shows all matching rows, not just the ones passed by the query... example is at http://www.experiencebaja.com/reviews.php?isbn=131166 with a valid isbn code for testing, if you try without you'll see nothing show up... I'll include the full code in case Dreamweaver is the culprit, but it's likely to be me :P [code]<?php require_once('dbconnection/ebc.php'); ?> <?php mysql_select_db($database_ebc, $ebc); $isbn = $_GET['isbn']; echo $isbn; //for testing $query_Recordset1 = "SELECT ebc_books.title, ebc_book_reviews.* FROM ebc_books, ebc_book_reviews WHERE ebc_books.isbn = '$isbn' "; $Recordset1 = mysql_query($query_Recordset1, $ebc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <title>Untitled Document</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="5">   <tr>     <td>isbn</td>     <td>title</td>     <td>reviewer</td>     <td>reviewer country </td>     <td>review</td>     <td>rating</td>     <td>visible</td>   </tr>     <?php do { ?>   <tr>       <td><?php echo $row_Recordset1['isbn']; ?></td>       <td><?php echo $row_Recordset1['title']; ?></td>       <td><?php echo $row_Recordset1['reviewer']; ?></td>       <td>&nbsp;</td>       <td><?php echo $row_Recordset1['review']; ?></td>       <td><?php echo $row_Recordset1['rating']; ?></td>       <td><?php echo $row_Recordset1['visible']; ?></td>       <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></tr> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> [/code]
  5. I need to pull data from two tables, one with book details, the other with review information. Linked together by ISBN numbers in both tables. Currently its giving me all matching rows, however, I want to pass an ISBN number from URL?isbn=1234567890123 and only show all reviews matching that ISBN. I can't add the extra code to use $_GET without it crashing: [code]<?php mysql_select_db($database_ebc, $ebc); $query_Recordset1 = "SELECT ebc_books.title, ebc_book_reviews.* FROM ebc_books, ebc_book_reviews WHERE ebc_books.isbn = ebc_book_reviews.isbn "; $Recordset1 = mysql_query($query_Recordset1, $ebc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <title>Untitled Document</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="5">   <tr>     <td>isbn</td>     <td>title</td>     <td>reviewer</td>     <td>reviewer country </td>     <td>review</td>     <td>rating</td>     <td>visible</td>   </tr>     <?php do { ?>   <tr>       <td><?php echo $row_Recordset1['isbn']; ?></td>       <td><?php echo $row_Recordset1['title']; ?></td>       <td><?php echo $row_Recordset1['reviewer']; ?></td>       <td>&nbsp;</td>       <td><?php echo $row_Recordset1['review']; ?></td>       <td><?php echo $row_Recordset1['rating']; ?></td>       <td><?php echo $row_Recordset1['visible']; ?></td>       <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></tr> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> [/code] I'm in Dreamweaver and know just enough PHP to get myself in trouble...
  6. I have set the .access and all html and php files to be enocding in utf. however, when i enter Japanese text into the mySQL db via web forms, it is sending garbage. the only workaround i have now is to manually enter the data into the database via phpAmin...then the data is displayed correctly in the website....so I feel the data is fine coming from the db, but the problem is in sending it... the database is on a shared server, so I cant convert the database type.... or can I? or... do I need to? any ideas?
  7. Thank you for your help. That solved the problem, but I needed to include the trailing code, so my end result was: $link_url = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/d.php?id='.$_COOKIE["file"]; and then <a href='$link_url'>some text</a>
  8. The link text is displaying the right link, but the href tag underneath is truncating... the following code: [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--] <a href=\"http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/d.php?id=".$file."\" title\"File\">http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/d.php?id=".$_COOKIE["file"]."</a><br><br><br></td></tr> <tr>[!--fontc--][/span][!--/fontc--] is generating the following html source: [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--] <a href="http://domain.com/send/jap/send/d.php?id=" title"File">http://domain.com/send/jap/send/d.php?id=2306d47066299f8cb5f380c4c4435c98</a><br><br><br></td></tr> [!--fontc--][/span][!--/fontc--] As you can see, some formatting in the above code is being interpreted against my wishes. If I can only get the href to match the link text, it will work. I'm quite sure it's a simple syntax error, but can't find which part...
×
×
  • 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.