CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012

    I have a problem with mysql database!

    Hi I'm making shopping cart and i have a problem displaying the products from the database. The language is PHP and here's a part of the code where I think the problem is? Can you help me? thanks
    <table border="0" cellpadding="2px" width="600px">
    			$result=mysql_query("select * from products");
            	<td><img src="<?php=$row['picture']?>" /></td>
                <td>   	<b><?php=$row['name']?></b><br />
                		<?php=$row['description']?><br />
                        Price:<big style="color:green">
                        	$<?php=$row['price']?></big><br /><br />
                        <input type="button" value="Add to Cart" onclick="window.location='shoppingcart.php'" />
            <tr><td colspan="2"><hr size="1" /></td>
            <? } ?>

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002

    Re: I have a problem with mysql database!

    Two problems right off.

    1. You should always use the full <?php tag opening. Not all servers have short tags enabled.

    2. You're not using echo. You're simply using =$row....
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.