Jump to content

JazzyB

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JazzyB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the quick reply. Adding single quotes works except for when the variable $details is data pulled from database: $query = "SELECT * FROM table WHERE status = 1 ORDER BY name LIMIT 0, 10"; $result = mysql_query($query) or die (mysql_error()."<br />Couldn't execute query: $query"); //then get your results onto your page. $num_rows = mysql_num_rows($result); $info = mysql_fetch_array($result); $details = $info['details']; The data in db is stored as text and first data is:
  2. Hi I am having a problem with data showing on a javascript tooltip. <?php $details = '<ul><li>list one </li><li>list two</li><li>list three </li><li>list four </li></ul>'; echo '<a href="javascript:void(0);" onMouseover="ddrivetip(\'.$details.\')" onMouseout="hideddrivetip()">More Details</a>'; ?> A tooltip appears when I put arrow over 'More Details' link however the tooltip shows '$details' instead of the actual list. Please help.
  3. Hi everyone, I have a form with checkboxes and I've assigned them names using numbers. The problem is it does not allow the following script to work: <script language=JavaScript> function checkAll(){ document.form.1.checked = true; document.form.2.checked = true; document.form.3.checked = true; } function unCheckAll(){ document.form.1.checked = false; document.form.2.checked = false; document.form.3.checked = false; } </script> Here's the form: <form name="form" id="form"> <table width="309" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F8F7F6"> <tr> <td width="122"><div align="right">Select All </div></td> <td width="20"> <input type="checkbox" name="checkbox" value="checkbox" onClick="if (this.checked){checkAll()} else if (!this.checked){unCheckAll()}" /></td> <td width="112"><div align="right">box1</div></td> <td width="25"> <input type=checkbox name=1 value=yes /> </td></tr> <tr> <td><div align="right">box2 </div></td> <td> <input type=checkbox name=2 value=yes /> </td> <td><div align="right">box3</div></td> <td><input type=checkbox name=3 value=yes /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit" /></td> <td> </td> </tr> </table> </form> The script works when the names of the checkbox contain letters. Is there any way that I can make it work with only numbers? Please help.
  4. Thank you UTAlan. The styles are now visible.
  5. Hey Kerblam, Thanks for the help, the email now gets sent once. I'm still having trouble with the CSS styles. The CSS style still shows as text. I'm searching the forum but I still haven't found anything similar to this issue unless theres something I've missed.
  6. I wish that could be it, tried it and still the same thing, I'm sure the style is closed with the double quotes correctly. I echoed it with php and the table style displays fine. Also when I send the email normally (without php code) as plain html the table style displays fine (I'm using hotmail to test this). The style displays as text only when I use the mail function. So now I know where the problem is only question is how do I resolve this? Any ideas? Anyone? ???
  7. Hi all, I'm having a problem sending email using php mail. The email is designed with tables so I'm using inline CSS styles. Problem is that the styles do not work. It gets displayed as text. Example: <?php $email_temp = '<html> <head> </head> <body> <table style="border:solid; border-color:#AD9090; border-left-width: 4px; border-right-width: 4px; border-top-width: 0px; border-bottom-width: 0px;" width="700" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> </table> </body> </html>'; mail($email, "Newsletter", $email_temp, "From: myemail@email.com" ); if(mail($email, "Newsletter", $email_temp, "From: myemail@email.com" )){ echo "The email was successfully sent."; } else { echo "The email was NOT sent."; } ?> This displays the style as text instead of the required borders eg. border-right-width: 4px; border-top-width: 0px; border-bottom-width: 0px;" width="700" border="0" cellspacing="0" cellpadding="0"> Also the email gets sent twice and I know it is because of the if clause but I'm not sure how else to put it. Please help.
  8. Hi, This is quite long and very complicated (at least for me). I have two tables in a database and want to use all the information from one table to pull out information from the other table. First table(favourites) records a list of users favourite artists the field names are user_id, artist_id, and artist_name. Second table(artists) contains artist information and also has the fields artist_id and artist_name. Here is my code that clearly doesn't do the above: [code]<?php if($_SESSION['first_name']){ $id = $_SESSION['id']; //CHECKING USER HAS ANY ARTISTS ADDED AS FAVOURITES $query = "SELECT * FROM favourites WHERE user_id = '$id'"; $result = mysql_query($query) or die (mysql_error()."<br />Couldn't execute query: $query");  //then get your results onto your page. $num_rows = mysql_num_rows($result); $info = mysql_fetch_array($result); $artist_id = $info['artist_id']; $artist_name = $info['artist_name']; while($row=mysql_fetch_array($result)) { $artist_id2 = $row['artist_id']; $artist_name2 = $row['artist_name']; } if($num_rows == TRUE){ //Mysql query to pull out details of artists from artists table $query2 = "SELECT * FROM artists WHERE artist_id = '$artist_id' AND artist_name = '$artist_name'"; $result2 = mysql_query($query2) or die (mysql_error()."<br />Couldn't execute query: $query2");  //then get your results onto your page. $num_rows2 = mysql_num_rows($result2); $info2 = mysql_fetch_array($result2); //echo 1st result here echo $info2['artist_name'].'<br />'; $query3 = "SELECT * FROM artists WHERE artist_id = '$artist_id2' AND artist_name = '$artist_name2'"; $result3 = mysql_query($query3) or die (mysql_error()."<br />Couldn't execute query: $query3");  //then get your results onto your page. $num_rows3 = mysql_num_rows($result3); $info3 = mysql_fetch_array($result3); //echo the rest of the results here echo $info3['artist_name']; while($row3=mysql_fetch_array($result3)) { echo $row3['artist_name']; } }else{ echo 'You currently have no artists added on your favourites list.'; } } else { echo '<p class="leftmargin">You need to be logged in to view this page:</p>'; include 'login_box.php'; } ?> [/code] Please can someone help me with this? Thanks, Jaz
  9. Hi, I am trying to send multiple data via one form. I have 4 tables each in the same form. Here is an example: [code] <form name="form1" id="form1" method="post" action="process.php">   <table width="428" border="0" cellspacing="6" cellpadding="0">     <tr>       <td>Field 1: </td>       <td><input type="text" name="field1" /></td>     </tr>     <tr>       <td>Field 2:</td>       <td><input type="text" name="field2" /></td>     </tr>     <tr>       <td>Field 3:</td>       <td><input type="text" name="field3" /></td>     </tr>     <tr>       <td>Field 4:</td>       <td><input type="text" name="field4" /></td>     </tr>   </table>   <br />   <table width="428" border="0" cellspacing="6" cellpadding="0">     <tr>       <td>Field 1: </td>       <td><input type="text" name="field1" /></td>     </tr>     <tr>       <td>Field 2:</td>       <td><input type="text" name="field2" /></td>     </tr>     <tr>       <td>Field 3:</td>       <td><input type="text" name="field3" /></td>     </tr>     <tr>       <td>Field 4:</td>       <td><input type="text" name="field4" /></td>     </tr>   </table> <br />   <table width="428" border="0" cellspacing="6" cellpadding="0">     <tr>       <td>Field 1: </td>       <td><input type="text" name="field1" /></td>     </tr>     <tr>       <td>Field 2:</td>       <td><input type="text" name="field2" /></td>     </tr>     <tr>       <td>Field 3:</td>       <td><input type="text" name="field3" /></td>     </tr>     <tr>       <td>Field 4:</td>       <td><input type="text" name="field4" /></td>     </tr>   </table>   <br />   <table width="428" border="0" cellspacing="6" cellpadding="0">     <tr>       <td>Field 1: </td>       <td><input type="text" name="field1" /></td>     </tr>     <tr>       <td>Field 2:</td>       <td><input type="text" name="field2" /></td>     </tr>     <tr>       <td>Field 3:</td>       <td><input type="text" name="field3" /></td>     </tr>     <tr>       <td>Field 4:</td>       <td><input type="text" name="field4" /></td>     </tr>   </table>   <p>     <input type="submit" name="Submit" value="Submit" />   </p> </form> [/code] Is it possible to send all this data to a mysql database, so that 4 rows are inserted in one go? If so please could you provide me with any info that would help. It would help a lot if anyone can provide an example. Many thanks in advance Jaz
×
×
  • 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.