Jump to content

jt2006

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jt2006's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That was it.  Worked on it for several hours yesterday.  Must have blocked out logic. Thanks so much!
  2. Thanks for taking the time to help me out. I'm trying to do what seems to be a simple select statement.  All I want is for someone to enter in their email address and check the database.  If it's there, retrieve that row. The problem is that I'm getting all confused as to the proper format of the select statement using the form variables.  I've seen .$variable.  '$variable'  and even '%".$variable."%'. Can someone take a look and help me out? Here's my code: $queryterm=$_POST['updateterm']; $hostname="server"; $username="DBuser"; $password="DBPassword"; $dbname="DBName"; $usertable="TableName"; mysql_connect($hostname, $username, $password) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); [color=purple]$query = mysql_query("SELECT * FROM '$usertable' WHERE " '$queryterm' "= email");[/color] if (!$query) {   die("query Failed. " . mysql_error()); } While ($row = mysql_fetch_array($result)) { echo $row['email']; }
  3. Thanks everyone. This helps a lot!
  4. [!--quoteo(post=387001:date=Jun 22 2006, 05:22 PM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ Jun 22 2006, 05:22 PM) [snapback]387001[/snapback][/div][div class=\'quotemain\'][!--quotec--] I presume you mean certain cells are 'collapsing' when there is no value, if that is the case, you could use an if statment for each cell ie if there is content/value then display it; if there is NO content/value display a non-breaking space or a transparent gif ( 1px high x whatever wide). Lite... [/quote] Not quite. The cell is there but there's no border lines seperating the cells. If you cut the generated HTML code, paste it in notepad and save it as .html then bring it up in a browser you'd see what I mean. Your If statement might work but I'm hoping there's another cleaner way. thanks for the reply, JT
  5. Hey all. Thanks for taking a look at this for me. I have a form on my site to store peoples names, addresses and so on. I only require that a few of the fileds be entered. Things like phone number or state and zip are optional. My problem is that when I display this information using the following format, any field that doesn't have a value also doesn't get my table formatting so I end up with a nice table border for first name and last name but I get a blank border for fields with no value. Here's my code and also a snippit of what my table looks like. Thanks, JT echo "<table border='1'>"; echo "<tr> <th>First Name</th> <th>Last Name</th> <th>Maiden Name</th> <th>Spouse</th> <th>Address</th><th>City</th><th>State</th><th>Zip</th><th>Phone</th><th>Email</th></tr>"; while($row = mysql_fetch_array($result)) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row[fname]; echo "</td><td>"; echo $row[lname]; echo "</td><td>"; echo $row[maiden]; echo "</td><td>"; echo $row[spouse]; echo "</td><td>"; echo $row[address]; echo "</td><td>"; echo $row[city]; echo "</td><td>"; echo $row[state]; echo "</td><td>"; echo $row[zip]; echo "</td><td>"; echo $row[phone]; echo "</td><td>"; echo $row[email]; echo "</td></tr>"; } echo "</table>"; echo "<br />"; ?> Results: <br /> <table border='1'><tr> <th>First Name</th> <th>Last Name</th> <th>Maiden Name</th> <th>Spouse</th> <th>Address</th><th>City</th><th>State</th><th>Zip</th><th>Phone</th><th>Email</th></tr> <tr><td>firstname</td><td>lastname</td><td></td><td>spouse</td><td>address</td><td>city</td><td>state</td><td>zip</td><td ></td><td>email</td></tr> </table>
×
×
  • 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.