Jump to content

Dicko_md

Members
  • Posts

    44
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Dicko_md's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Sorry I wasnt trying to get the code for free without trying. I was genuinely not sure how to incorporate this into your code you shared. I have probably gone about it the wrong or should I say long way round but it works below after playing with my code. $result = mysql_query("Select DISTINCT phone.model, phone.model_no, phone.icon, phone.year, phone.capacity From phonerepairs INNER JOIN phone ON phonerepairs.phone=phone.phone WHERE phone.model_no='".$_POST['model']."'"); $result2 = mysql_query("Select * From phonerepairs INNER JOIN phone ON phonerepairs.phone=phone.phone WHERE phone.model_no='".$_POST['model']."'"); while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td width="70" align="center"><img src="'.$row['icon'].'" width="66"></td>'; echo '<td width="100" align="center">'.$row['model_no'].'</td>'; echo '<td width="130" align="center">'.$row['model'].'</td>'; echo '<td width="50" align="center">'.$row['year'].'</td>'; echo '<td width="150" align="center">'.$row['capacity'].'</td>'; echo '</tr>'; } echo '</table><br></p>'; while($row = mysql_fetch_array($result2)) { echo '<p>'; echo '<div id="pageheading"><h3><div id="title">Repairs we carry out for '.$row['model'].'</div></h3></div>'; echo '<table width="99%" cellpadding="5" cellspacing="0" border="1">'; echo '</p>'; echo '<p>'; echo '<tr>'; echo '<td align="center"><strong>Image</strong></td>'; echo '<td align="center"><strong>Fault</strong></td>'; echo '<td align="center"><strong>Repair</strong></td>'; echo '<td align="center"><strong>Cost</strong></td>'; echo '</tr>'; echo '<tr>'; echo '<td width="70" align="center"><img src="'.$row['icon'].'" width="66"></td>'; echo '<td width="100" align="center">'.$row['fault'].'</td>'; echo '<td width="130" align="center">'.$row['description'].'</td>'; echo '<td width="50" align="center">&pound'.$row['cost'].'</td>'; echo '</tr>'; echo '</table><br>'; } mysql_close($con); ?> </p> The only nicety thing I would like if possible is to alternate the table heading on each fix available if its a quick fix. Thanks Martyn
  2. Any one able help to show me how to use the above code with my code ? Thanks Martyn
  3. Hi Thanks for your reply. Would I be best keeping the 2 tables separate and use your code above ? I have one column in each table that is the same ie phone so this could be the stored variable. How would I get my code into your suggestion to output the available repairs for a particular phone. ? Thanks again Martyn
  4. Hi I have 2 tables that I am searching infor for. One holds the phone info and the other the repairs that are available. I have the code below and it displays on the webpage in a table for the phone information and then another table the repairs but they seem to be separate tables and headers. inbetween them is the phone and the details which separates the repairs but its not in a table. Hopefully the code below will explain better. What I would like it the phone details in one table and then a table full of all the repairs (I am not bothered about a new heading for each repair). $result = mysql_query("SELECT * FROM phone, phonerepairs WHERE phone.model_no='".$_POST['model']."' AND phone.phone = phonerepairs.phone"); while($row = mysql_fetch_array($result)) { echo '<td width="70" align="center"><img src="'.$row['icon'].'" width="66"></td>'; echo '<td width="100" align="center">'.$row['model_no'].'</td>'; echo '<td width="130" align="center">'.$row['model'].'</td>'; echo '<td width="50" align="center">'.$row['year'].'</td>'; echo '<td width="150" align="center">'.$row['capacity'].'</td>'; echo '</tr>'; echo '</table><br>'; echo '</p>'; echo '<p>'; echo '<div id="pageheading"><h3><div id="title">Repairs we carry out for '.$row['model'].'</div></h3></div>'; echo '<table width="99%" cellpadding="5" cellspacing="0" border="1">'; echo '</p>'; echo '<p>'; echo '<tr>'; echo '<td align="center"><strong>Image</strong></td>'; echo '<td align="center"><strong>Fault</strong></td>'; echo '<td align="center"><strong>Repair</strong></td>'; echo '<td align="center"><strong>Cost</strong></td>'; echo '</tr>'; echo '<tr>'; echo '<td width="70" align="center"><img src="'.$row['icon'].'" width="66"></td>'; echo '<td width="100" align="center">'.$row['fault'].'</td>'; echo '<td width="130" align="center">'.$row['description'].'</td>'; echo '<td width="50" align="center">&pound'.$row['cost'].'</td>'; echo '</tr>'; echo '</table><br>'; Thanks in advance Martyn
  5. Thank you all for your help. Im definately learning slowly. Martyn
  6. <a class="dark" href='index_1.php?s=remindpass'>FORGOT PASSWORD</a> This is the offending line. I removed it and it worked fine. Does anything stand out ?
  7. Hi That didn't work. I got the same. Thanks again
  8. Nothing is been output. just says below and no arrows next to them with any code in <head></head> <body></body> Thanks
  9. Thanks reading now but if anyone knows why its doing it. please tell. thanks again
  10. I have changed he " to ' onfocus but that hasn't changed anything. I get nothing output. The webpage is just white. Not sure how to debug Thanks
  11. This is what I tried. function FormLogin() { $html = " <form method='post' name='forml' action='index_1.php?s=login'> <input type='hidden' name='dologin' value='1'> <input type='text' name='email' value='email' onfocus="if (this.value=='email') this.value='';"/> <input type='password' name='password' value='password' onfocus="if (this.value=='password') this.value='';"/> <input type='submit' name='login' id='submit' value='SIGN IN' class='submit'> <a class="dark" href='index_1.php?s=remindpass'>FORGOT PASSWORD</a> <script language='javascript'> document.forml.email.focus(); </script> </form> "; return $html; } Ive tried with and without the script. Im guessing it is something with the " on the onfocus as its closing the line. Ive also tried \" also Thanks Martyn
  12. <form method='post' name='forml' action='index_1.php?s=login'> <input type='hidden' name='dologin' value='1'> <input type='text' name='email' value='email' onfocus="if (this.value=='email') this.value='';"/> <input type='password' name='password' value='password' onfocus="if (this.value=='password') this.value='';"/> <input type='submit' name='login' id='submit' value='SIGN IN' class='submit'> <a class="dark" href='index_1.php?s=remindpass'>FORGOT PASSWORD</a> </form> Ive just tried this in the normal php file and it works fine. When I tried taking off the " off the onfocus to ' it left the EMAIL and ****** in the boxes.
  13. Hi Im still learning and no I haven't. How would I do that ? I know it works in a normal php file but I was wondering if its the " around the onfocus as the other items can have ' instead Thanks
  14. This is my current code but if I try and swap the code function FormLogin() { $html = " <div id='login'> <form method='post' name='forml' action='index_1.php?s=login'> <input type='hidden' name='dologin' value='1'> <table cellpadding='2'> <tr><td class='formlabel'>Email:</td><td><input type='text' name='email' value='EMAIL' style='width: 100%'></td></tr> <tr><td class='formlabel'>Password:</td><td><input type='password' name='password' style='width: 100%'></td></tr> <tr><td> </td><td><input type='submit' class='submit' name='login' value='SIGN IN' id='submit' style='width: 100%'></td></tr> <tr><td> </td><td><p align='center'><a class='dark' href='index.php?s=remindpass'>FORGOT PASSWORD</a></p></td></tr> </table> <br /></div> <script language='javascript'> document.forml.email.focus(); </script> </form> "; return $html; } with the below it doesn't work. I have tried swapping the " with ' and that didn't work. Have I missed something as the below code works in a normal php file . <form method='post' name='forml' action='index_1.php?s=login'> <input type='hidden' name='dologin' value='1'> <input type="text" name="email" value="email" onfocus="if (this.value=='email') this.value='';"/> <input type="password" name="password" value="password" onfocus="if (this.value=='password') this.value='';"/> <input type="submit" name="login" id="submit" value="SIGN IN" class="submit"> <a class="dark" href='index_1.php?s=remindpass'>FORGOT PASSWORD</a> </form> Thanks in advance Martyn
  15. Sorry my fault. Oversight. I had 2 emails as it was an if statement and I hadn't updates the $timestamp in the other email script. Sorry and thanks
×
×
  • 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.