simplypixie 123 Posting Pro in Training

You need to var_dump($_POST), not $query and the reason that is showing as soon as the page loads is because it is not contained within you if statement to check if the form has been submitted and will obviously be empty at that point.

You also have to curly brackets around you else statement.

simplypixie 123 Posting Pro in Training

You need to add md5() around all your references to the password that you want to look up in the database, i.e.

$newpassword = md5(mysql_real_escape_string($_POST['newpassword']));
simplypixie 123 Posting Pro in Training
rotten69 commented: Please understand the Question before you reply. Thank you. +0
simplypixie 123 Posting Pro in Training

Use foreach on the 2nd array and then compare the results in the foreach against the first array using in_array

simplypixie 123 Posting Pro in Training

Have you tried running the query in PHPMyAdmin (obviously putting in some data in place of the variables) and see what happens? It should give you an error message if it is your query that isn't working.

simplypixie 123 Posting Pro in Training

Oh yes, I had missed that - you can't use an alias like you are. Just change the where clause to use your correct column

WHERE TaskDueDate = date('Y-m-d')
simplypixie 123 Posting Pro in Training

Just realised your column to compare with today's date is formatted incorrectly, should be:

SELECT count(TaskID) AS DueToday, DATE_FORMAT(`TaskDueDate`,'%Y-%m-%d') AS XLABEL FROM tasks
WHERE `XLABEL` = date('Y-m-d') AND Completed = 'No'

You had ' ' around the XLABEL which is incorrect, is using quotes around column names they should be like ` `. Or you can just get rid of them altogether to prevent this issue in future (for instance you haven't put them around your Completed column name).

Also check that your column names are in the correct case as they are case sensitive - so is your XLABEL column actually all in caps in your database?

simplypixie 123 Posting Pro in Training

Firstly, to correct your script:

<?php
....
$conn ...blah blah blah...
mysql_select_db ...blah blah blah...
....

$query = mysql_query("SELECT * FROM teamdb WHERE sports='Basketball'");

....
?>
<html>
....

<select name='whatever'>
<?php
while($row = mysql_fetch_array($query))
{
echo '<option value"='.$row['teamid'].'">'.$row['teamname'].'</option>';	

}
?>
</select>

....
</html>
simplypixie 123 Posting Pro in Training

Not sure if it is a typo in your post but you URL isn't sending the price - it finishes at &Variable and also the $price variable should not be in speech marks. If this isn't a typo (I am not sure what value should be attached to Variable so I have removed for now) you should have

https://usd.swreg.org/cgi-bin/s.cgi?s=133537&p=133537-2&q=1&v=0&d=0&Pricing=<?php echo $price;?>"
simplypixie 123 Posting Pro in Training

Try changing

CURDATE()

to

date('Y-m-d')
simplypixie 123 Posting Pro in Training

jQuery is not a replacement for JavaScript it is a JavaScript library to make coding with it faster, cleaner and easier. There is no replacement for JavaScript.

Shanti C commented: Yes,thank you.. +11
simplypixie 123 Posting Pro in Training

I presume your problem is that the black background is only applied to the links whereas you want some padding between your link text and the edge of the black background. If this is the case then as you are only applying your black background to the link then what you have is correct, you need to apply the background to the containing element as well, in the case your li.

#article-sidebar li:hover, #article-sidebar li ul li:hover {
	background-color: black;
}
simplypixie 123 Posting Pro in Training

You need to use a while loop, as such:

$email = mysql_query("SELECT * FROM mail") or die (mysql_error());

while ($row = mysql_fetch_array($email)) {

echo $row['email'].'<br>';

}

The <br> is just to break up your results for this example.

simplypixie 123 Posting Pro in Training

I can't answer that as I didn't develop jQuery - maybe you should go to the jQuery website and ask them.

However the $ symbol is used in programming to indicate variables in use so maybe that is why - it is calling the jQuery variable.

simplypixie 123 Posting Pro in Training

I like the book The Principals of Beautiful Web Design - http://bit.ly/v9Py9C and also Simple and Usable is a good read to get you thinking - http://amzn.to/tysQVP

simplypixie 123 Posting Pro in Training

Please try running your insert query actually in the database and see what it says (i.e. does it work or does it throw up an error) - it may be that your comment column in the table is set to the wrong format.

Also, despite the Undefined Variable (which actually just means you haven't defined the $comment Variable in the script and is actually a very minor issue), is your data actually being inserted into your database?

simplypixie 123 Posting Pro in Training

I am presuming the user_id is an auto_increment in your table and therefore you don't need to reference it in your INSERT query and as it is empty it is probably causing you a problem. Change your INSERT to:

$sql = "INSERT INTO dig_users (username, useremail, comment) VALUES ('$username', '$email', '$comment')";
simplypixie 123 Posting Pro in Training

Can you show your other function that is disabling the check boxes and the form itself please

simplypixie 123 Posting Pro in Training

Unfortunately I don't think I can help but I think you mean to display code like you would on this forum, in code tags, and I don't know how to do that (mainly because I have needed to do it so haven't looked into how it is done).

With regard to hidden content which shows on the click of a button that would need a mix of CSS and JavaScript - many tutorials on the web.

Sorry to have not been more help.

simplypixie 123 Posting Pro in Training

Which query are you trying to run? Is the insert query working? Are there any records in your table?

simplypixie 123 Posting Pro in Training

I am not sure if this is the problem as you haven't put your coe in code tags in your post so I don't know where the line causing the error actually is, but you have an error here (an extra comma after the 'comment' column name):

$sql = "INSERT INTO `dig_users` ('user_id', 'username', 'useremail','comment' , ) VALUES

Should be:

$sql = "INSERT INTO `dig_users` ('user_id', 'username', 'useremail','comment') VALUES

I would also recommend running your sql statement in the actual database when you get errors like this as it is easier to de-bug.

simplypixie 123 Posting Pro in Training

Can I ask why you want to show code on a website?

simplypixie 123 Posting Pro in Training

I am currently learning JavaScript, so forgive me if I am wrong but I was lead to believe that there is no function getElementsByClassName, you have to create it as a function yourself to be able to use it.

I am also not sure that removeAttribute works in IE (not sure what browser you are using).

simplypixie 123 Posting Pro in Training

What are you asking? How to develop the calculator in jQuery or where to learn jQuery?

simplypixie 123 Posting Pro in Training

It is just a short code for the jQuery variable. So instead of writing your code:

jQuery(document).ready(function() {
.
.
.
});

You can write:

$(document).ready(function() {
.
.
.
});
simplypixie 123 Posting Pro in Training

pritaeas - Sorry, obviously shouldn't post when I have only been awake for half an hour:-))

simplypixie 123 Posting Pro in Training

You could compare total number of results with your count increment in the while loop and use that:

<?php 
 $query="select * from posts order by id desc";
 $result = mysql_query($query); 
$numrows = mysql_num_rows($result);
 $i = 0;
  
     while($row=mysql_fetch_array($result))
           {
             $i++;
             $id=$row['id'];
             $name=$row['name'];
	     $post=$row['post']; 

             if ($i < $numrows) { $class = 'posts'; }
             else { $class = 'laspost'; }

             ?>  
           
    <div class="<?php echo $class; ?>">
    <div class="numbered">#<?php echo $i; ?></div>
    <div class="postername"><?php echo $name ?></div>
    <div class="post"><?php echo $post; ?></div></div>
   
      <?php } ?>

Or you could try using :last-child in your CSS (you may need a containing div as it will select the last child of the parent element).

simplypixie 123 Posting Pro in Training

If it is as simple as finding extra commas and/or whitespace then (using prieas example with one extra line and a new variable):

$data = $_POST['data'];
$newdata = str_replace(",,", ",", trim($data));
$words = explode(',', $newdata);
foreach ($words as $word)
{
  if (!empty(trim($word)))
  {
    $newwords[] = $word;
  }
}
simplypixie 123 Posting Pro in Training

You need to have text-align: center; in your body css

simplypixie 123 Posting Pro in Training

I understand now - I don't have an answer for you with regard to your format but why don't you use the mysql date formats available as they will then store all your date/time information correctly so you will be able to ORDER BY them and then just re-format your dates when you echo out the dates on the front end?

It makes no sense to me to store your dates and times in a custom format when you don't need to and subsequently cause problems in ordering as you are having.

simplypixie 123 Posting Pro in Training

To fetch any data in a specific order from a database table you just need to use the ORDER BY sytax. So in your example:

"SELECT * FROM tablename ORDER BY date ASC"

Replace tablename with the name of your table, date to the name of your date field and use ASC to retrieve in the order of oldest date first or DESC for most recent first.

You don't say what format you want the date to display in so I can't answer that for you specifically, however if you want something like day/month/year your PHP would be:

echo date('dd/mm/Y', $dateresult);

Replace $dateresult with your specific date result variable.

Hope this helps.