Jump to content

jwwceo

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by jwwceo

  1. The HTML is easy.... I need tips on the php part...
  2. I am looking for a tutorial on building a product gallery where products are diplayed in a grid format, like this [url=http://www.bustedtees.com]www.bustedtees.com[/url]. I mostly need to know how to get the search results to display 4 across. Right now, I can just get them to make a big list, where each entry is a row in a table.... Are there any tutorials on this online anywhere..or anyone have any tips on how to do this....
  3. But why isn't it required to be declared at the top of the script. Even if it's null. I though all variables need to be declared before you can use them???
  4. I have a very basic question. Below is a simple snippet to retrieve info from a database. I tweaked it to work with my fields and it works fine. My question is...why is $info not declared at the start of the script. Don't I have to declare all my variables?? Also is there any command that doesn't require echo to go on every line that's outputted...but rather just outputs everything between a start and end "print" command?? _________________________ <?php // Connects to your Database include 'library/config.php'; include 'library/opendb.php'; $data = mysql_query("SELECT * FROM shirts") or die(mysql_error()); echo "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data )) { echo "<tr>"; echo "<th>Name</th> <td>".$info['name']."</td> "; echo "<th>Web Site</th> <td>".$info['site']." </td>"; echo "<th>Comment</th> <td>".$info['comment'] . "</td> "; echo "<th>Link</th> <td>".$info['link']."</td>"; echo "<th>Image</th> <td>".$info['image']."</td> "; echo "<th>Commission</th> <td>".$info['commission']." </td>"; echo "<th>Active</th> <td>".$info['active']."</td></tr>"; } echo "</table>"; ?>
  5. That was probably it... The page would load but when you submitted the form..nothing happened...it simply cleared the data, like a reload.... Is there any place to check error logs so I can see if there is a syntax error on line X??? I have error logs on Apache..and the browser will display the MySQL error if I have the tags set up right...but I can't find a place to find error logs for the PHP itself...
  6. That worked. I totally appreciate it. I noticed what you changed..but what was wrong? I copied several online tutorials to the tee... THANKS AGAIN! JAMES
  7. Hey all.. I am trying to write my first PHP file that will write to a database, MySQL. I just can't get this to work. I've been playing with this for hours...any obvious things wrong with this code...thanks in advance... <html> <head> <title>Add A Shirt</title> </head> <body bgcolor="#FFFFFF"> <? if($_POST['submit']) {   mysql_connect("localhost","root","9579");   mysql_select_db("tees");   $shirt_id=$_POST['shirt_id'];   $name=$_POST['name'];   $comment=$_POST['comment'];   $link=$_POST['link'];   $site=$_POST['site'];   $image=$_POST['image'];   $active=$_POST['active'];   $commission=$_POST['commission'];   $result="INSERT INTO shirts (shirt_id,name,comment,link,site,image,active,commission)  VALUES ('NULL', '$name', '$comment', '$link', '$site', '$image', '$active', '$commission' )";   mysql_query($result);   echo "Thanks for adding the tee";   ?> <? else { ?> <form method="post" action="add.php"> <TABLE> <TR>   <TD>Name:</TD>   <TD><INPUT TYPE='TEXT' NAME='name'  size=100></TD> </TR> <TR>   <TD>Comment</TD>   <TD><INPUT TYPE='TEXT' NAME='comment'  size=100></TD> </TR> <TR>   <TD>Link</TD>   <TD><INPUT TYPE='TEXT' NAME='link'  size=100></TD> </TR> <TR>   <TD>Site</TD>   <TD><INPUT TYPE='TEXT' NAME='site'  size=100></TD> </TR> <TR>   <TD>Image</TD>   <TD><INPUT TYPE='TEXT' NAME='image'  size=100></TD> </TR> <TR>   <TD>Active</TD>   <TD><INPUT TYPE='TEXT' NAME='active'  size=100></TD> </TR> <TR>   <TD>Commission</TD>   <TD><INPUT TYPE='TEXT' NAME='commission' size=100></TD> </TR> <TR>   <TD></TD><br>   <TD><INPUT TYPE="submit" name="submit" value="Add this Tee"></TD> </TR> </TABLE> </form> <? } ?> </body> </html>
×
×
  • 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.