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

I would look at using something like Wordpress

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

It is a PHP operator used to call methods and properties of a PHP class (used in Object Oriented PHP).

This tutorial may help you understand better http://bit.ly/vS6H9P

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

The for loop is incorrect but you are better off using a while loop as much easier for what you require:

$sql1 = mysql_query("SELECT equipmentid, description FROM equipment") or die(mysql_error());
while ($row = mysql_fetch_assoc($sql1)) {
echo '<input type="checkbox" name="equipment" value="$row['equipmentid']"/>
}
simplypixie 123 Posting Pro in Training

On the receiving page you need to use

$id = $_GET['id'];

not $_POST as you are not posting the data (you would be if using a form to pass the data) you are sending in a URL and therefore need to use $_GET.

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

Not sure if I completely understand what you are trying to do but if you want the table to expand without expanding the containing div then you need to set a maximum height and hide the overflow in your main div:

#main {
height: 400px;  
overflow: hidden;
}

You can use

overflow: scroll;

instead if you want the user to be able to scroll in the main div to the bottom of the content (i.e. all the table rows that are hidden).

simplypixie 123 Posting Pro in Training

Search google

simplypixie 123 Posting Pro in Training

Can you post your css

simplypixie 123 Posting Pro in Training

Is anything actually being set to your session? Use var_dump to check your session variables have values:

var_dump($_SESSION);

If they have then try changing

if(!$_SESSION['valid_user'] == 1)

to:

if(!isset($_SESSION['valid_user']) || $_SESSION['valid_user'] !=1)
simplypixie 123 Posting Pro in Training

I see the problem in Chrome as well. Firstly can you post your css and secondly a great way of checking problems like this is to add temporary borders to your divs/classes so you can see where the overlaps are actually happening.

simplypixie 123 Posting Pro in Training

You are not changing the background colour of your td which also has padding. I am not sure why you are applying the a:hover to the whole table rather than the tr or td only but add td a: hover as well and it may help:

table a:hover, td a:hover {
color: white; 
background-color: red;
}
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

hfx642, thank you for the explanation. I didn't say you were being rude I just don't think you can say something will that without expanding on the reasons why, which you have now done.

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

Sorry but I am not here to write code for people unless they already have code that they are having a problem with. If you want to get this to work you need to go off and learn PHP for which there are hundreds of resources across the web.

simplypixie 123 Posting Pro in Training

hfx642 - instead of just writing this

I REALLY don't like to use "NOT in"!!!

Why not explain why as well.

simplypixie 123 Posting Pro in Training

Please post your script and an example of your html where you want the text to change

simplypixie 123 Posting Pro in Training

The first question you need to answer is what are you searching - records in a database or the website itself?

simplypixie 123 Posting Pro in Training

Not sure what you are trying to do on line 28 but for one you have already called session_start() on line 3 so you don't need to call it again, plus session_register is deprecated and you can shorten your code, try:

//log in
//username
if($_POST['Enter']){
$myemail=mysql_real_escape_string(stripslashes($_POST['myemail']));
$mypw=mysql_real_escape_string(stripslashes($_POST['mypw']));
$sql="SELECT * FROM tbl_users WHERE myemail='".$myemail."' and mypw ='".$mypw."'";
$result = mysql_query($sql);
//mysq_num_row is counting table now
$count = mysql_num_rows($result);
if($count==1){
$_SESSION['myemail']=$myemail;
$_SESSION['mypw']=$mypw;
header("location:index.php");
simplypixie 123 Posting Pro in Training

In MySQL I would use:

SELECT client_id FROM client WHERE client_id NOT IN (SELECT client_id FROM purchase) ORDER BY client_id DESC
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

Sorry to be harsh but I suggest you go and learn about MySQL and PHP from the hundreds of resources and tutorials online.

simplypixie 123 Posting Pro in Training

I still suggest putting a temporary border around your image )(in the CSS) as it may be that the width is more than you thought which is pushing the text down.

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

You would need to use JavaScript/Ajax to run your php script on selection from the dropdown list and then populate the textbox with the query results

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

Float the image left and put a 1px border around the image and the intro text (remove after testing) to check where they are positioning on the page (i.e. if they are overlapping which would push the text down).

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

Are you sure you are redirecting to the correct page as this information is conflicting:

// the secret.php page is the page the user goes after he logs in successfully
header("Location:member.php");

You say they are redirected to secret.php when logged in successfully but in your header location you are redirecting to member.php.

Just a thought

simplypixie 123 Posting Pro in Training

This should do it (replace table_name with the name of your table):

SELECT count(ForumPostsId) as posts, ForumPostsId FROM table_name WHERE parentpost=0 GROUP BY ForumPostsId
simplypixie 123 Posting Pro in Training

Firstly (this may not resolve your problem). The auto in the margin element should be specified in the #mainContainer div, not in the body and the body needs to be centered using text-align:

body
{
  height:100%;
  width:100%;

  margin:0; 
  text-align: center;

  background-image: -webkit-linear-gradient(top, #E5E5E5 30%, #999);
  background-image: -moz-linear-gradient(top, #E5E5E5 30%, #999);
  background-image: linear-gradient(top, #E5E5E5 30%, #999);

}
simplypixie 123 Posting Pro in Training

Yes that is correct and page= is called whatever you want to use as your get value on the next page so as in any variable declarations you can call it what you like.

simplypixie 123 Posting Pro in Training

It adds the correct data to the end of the URL that will be used by $_GET (in PHP) on the next page/set of results to display the next set of results.

So if you are on page 1 or results and click on the link to go to page 2, with the code example, the link in the address bar would look like pagination_data.php?page=2 and this tells the script that you want to view page 2 of the results.

So, in short, it is used to send information in the URL to the receiving page which is then accessed using $_GET.

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

Or you could use CSS to apply your image as the submit button

simplypixie 123 Posting Pro in Training

They poster is not being ignorant, they are asking for genuine advice and at least they asked unlike some who still seem to just go ahead and use tables for layout - we all started somewhere. All you had to put was that it was a no-no and suggest they search on Google. There is no need for rudeness.