Jump to content

Search the Community

Showing results for tags 'php href variables mysql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello everyone, i'm struggeling with posting a link with variables in a table with info i receive from a database. The variable $url = "http://mtgimage.com/card/$cardname.jpg"; works but the variable $cardname = $row['Name']; doesnt. i dont know what i am doing wrong in that line of code. my actual goal with this is so when i hover over the card name which i receive from the database it shows the image. This is the actual full file. <!DOCTYPE html> <html> <head> <title>MTG Card List</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css" media="screen"> @import "filtergrid.css"; body{ margin:15px; padding:15px; border:0px solid #666; font-family:Arial, Helvetica, sans-serif; font-size:88%; } h2{ margin-top: 50px; } caption{ margin:10px 0 0 5px; padding:10px; text-align:left; } pre{ font-size:13px; margin:5px; padding:5px; background-color:#f4f4f4; border:1px solid #ccc; } .mytable{ width:100%; font-size:12px; border:1px solid #ccc; } th{ background-color:#003366; color:#FFF; padding:2px; border:1px solid #ccc; } td{ padding:2px; border-bottom:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; border-top:1px solid #ccc; } body p { font-size: 50%; color: #000; } a:link { color: #000; } a:visited { color: #000; } </style> <script language="javascript" type="text/javascript" src="actb.js"></script> <script language="javascript" type="text/javascript" src="tablefilter.js"></script> </head> <body> <form align="center" action="password.php" method="POST"> <b>Username:</b> <input type="text" name="username"> <b>Password:</b> <input type="text" name="password"> <input type="submit"> </form> <?php $dbhost = 'hostname'; $dbuser = 'user'; $dbpass = 'pw'; $cardname = $row['Name']; $url = "http://mtgimage.com/card/$cardname.jpg"; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } mysql_select_db('e_industries'); $sql = 'SELECT `Name`, `Color`, `Type`, `Subtype`, `Power`, `Toughness`, `Manacost`, `Rarity`, `Expansion`, `Foil`, `Stock` FROM `Osiris`'; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } echo '<table align="center" id="mytable" cellspacing="0" class="table" >'; echo "<tr><th >Name</th><th >Color</th><th >Type</th><th >Sub Type</th><th >Power</th><th >Toughness</th><th >Converted mana cost</th><th >Rarity</th><th >Expansion</th><th >Foil</th><th >Stock</th></tr>"; while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "<tr><td>"; echo "<a href=$url>. $cardname .</a>"; echo "</td><td>"; echo $row['Color']; echo "</td><td>"; echo $row['Type']; echo "</td><td>"; echo $row['Subtype']; echo "</td><td>"; echo $row['Power']; echo "</td><td>"; echo $row['Toughness']; echo "</td><td>"; echo $row['Manacost']; echo "</td><td>"; echo $row['Rarity']; echo "</td><td>"; echo $row['Expansion']; echo "</td><td>"; echo $row['Foil']; echo "</td><td>"; echo $row['Stock']; echo "</td></tr>"; } echo "</table>"; mysql_close($conn); ?> <script language="javascript" type="text/javascript"> //<![CDATA[ var table2_Props = { col_1: "select", col_2: "select", col_3: "select", col_7: "select", col_8: "select", col_9: "select", col_10: "none", display_all_text: " [ Show all ] ", sort_select: true }; setFilterGrid( "mytable",table2_Props ); //]]> </script> </body> </html> Thanks in advance!
×
×
  • 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.