simplypixie 123 Posting Pro in Training

In this case you just need one IF statement to check

if ($s_veration <= $remnder_ver) {
echo" <strong>Specific Variation</strong> ought to have a value grater than <strong>Reminder Variation</strong>, please go back and alter your values";
}

You shouldn't be exiting either so leave that out

simplypixie 123 Posting Pro in Training

Thank you so much @pritaeas I have implemented the function and it appears to be working brilliantly.

online_profile_url: { 
				url: {
					depends: function () {
						return $("#online_profile_url").attr("value") !== 'http://';
					}
				}
			}
pritaeas commented: Thanks for sharing. +14
simplypixie 123 Posting Pro in Training

A few things - firstly you have out your die on the next line, php needs to be on one line, secondly you are running your mysql_query twice and thirdly you are trying to run two queries in your while loop.

This should work (unless there are other problems):

include ("config.php"); 
// select data from database   
$w3db = mysql_query( "SELECT * FROM w3dbx" ) or die("SELECT Error: ".mysql_error());
$worth = mysql_query( "SELECT * FROM worth" ) or die("SELECT Error: ".mysql_error());
			
// fetching data 
//while ($get_infox = mysql_fetch_assoc($resultx) && $get_info = mysql_fetch_assoc($result))
while ($get_w3db = mysql_fetch_array($w3db)) {
// code here
}
while ($get_worth = mysql_fetch_array($worth)) {
// code here
}

If you need to display the two sets of query results together you will either have to change your query to one using joins of run your second query within your first while loop.

simplypixie 123 Posting Pro in Training

To prevent the gap, remove cellspacing from the table (or set it to 0).

simplypixie 123 Posting Pro in Training

Undefined index is just a warning, not an error and it is just advising to check if the variable exists or has a value so all you have to do is out an if statement in your code and in your case around the whole php by the look of it:

<?php
if (isset($_POST['add_item1'])) { 
// Your current php code here
}
?>
simplypixie 123 Posting Pro in Training

You need to use mysql_real_escape_string

$value = htmlspecialchars(mysql_real_escape_string($_POST['Name']));
simplypixie 123 Posting Pro in Training

What exactly is the problem? For example do any of your errors display or does it appear to go trhough but doesn't actually update?
There are actually 2 errors in your code that I can see

else

        if($password != mysql_result($result, 0)){

            echo "Entered an incorrect password";

            }

You are missing the surrounding parenthesis for your else statement

else {

        if($password != mysql_result($result, 0)){

            echo "Entered an incorrect password";

            } }

Then you are saying if not $sql the success, should be the other way around

if($sql){

        echo "Congratulations, password successfully changed!";

   }
simplypixie 123 Posting Pro in Training

You need session_start() at the top of every page where you use sessions and no you don't need session_regenerate_id() (that question was in case you were using it in error).

simplypixie 123 Posting Pro in Training

I see what you are doing now and there is no reason or need to have a whole html page echoed in php so change (plus you are correct you can't use <?php ?> within other php tags but the way you are doing things you also need to end and restart <<< HTML each time you want to echo php.
Change both your registration and registration failed pages.
Registration:

<?php

    require_once('InitDB.php');
?>    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Member Login</title>
    <link rel="stylesheet" type="text/css" media="screen" href="registration.css" />
    </head>
    <body>
.
.
.
.
.
.
 </body>
    </html>

Fail page:

<?php

    require_once('InitDB.php');
    session_start();
    
    $errmsg1 = $_SESSION['ERR_MSG1'];
    $errmsg2 = $_SESSION['ERR_MSG2'];
    $errmsg3 = $_SESSION['ERR_MSG3'];
    $errmsg4 = $_SESSION['ERR_MSG4'];
    $errmsg5 = $_SESSION['ERR_MSG5'];
    $ovrerrmsg = $_SESSION['OVR_ERR_MSG'];
 ?>   
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Member Login</title>
    <link rel="stylesheet" type="text/css" media="screen" href="registration.css" />
    </head>
    <body>
.
.
.
.
.
    </body>
    </html>
BenzZz commented: Well explained! +3
simplypixie 123 Posting Pro in Training

You query is not formatted correctley

select  NAME from TAB1 left join TAB2 on  TAB1.ID = TAB2.ID where TAB1.NUMBER= TAB2.NUMBER;

Or if you are trying to join with a 3rd table

select  NAME from TAB1 left join TAB2 on  TAB1.ID = TAB2.ID LEFT JOIN TAB3 ON TAB3.NUMBER=TAB2.NUMBER where Put Your Where Clause Here;
vedro-compota commented: ++++++++++ +3
simplypixie 123 Posting Pro in Training

Find the query that inserts the user's data into the database and change the status_code to equal P instead of A. The code you posted is not relevant to what you are asking for help with so I can't be more specific.

simplypixie 123 Posting Pro in Training

Sorry, I forgot the ( ) around the values, so it should be

$insertSQL = "INSERT INTO blog (title, specialization, message, email) VALUES (' " . mysql_real_escape_string($_POST['title'])  . " ', ' " . mysql_real_escape_string($_POST['specialization']) . " ', ' " . mysql_real_escape_string($_POST['words']) . " ', ' " . mysql_real_escape_string($_SESSION['MM_Username']) . " ')";

  mysql_select_db($database_con_reg, $con_reg);
  $Result1 = mysql_query($insertSQL, $con_reg) or die(mysql_error());
BilalAKhan commented: Solved my problem... thanx a million. +1
simplypixie 123 Posting Pro in Training

OK, an example, you have a table called customers and each customer has an id and you want to select all the details for the customer with an id of 1 (this is so simple it should work so it is not a query that will fail, just adjust to match your table and column name(s)).

Login to phpMyAdmin, select the correct database on the left menu and then click the SQL tab towards the top of the page then type or copy in your query, in this case

SELECT * FROM customers WHERE id=1

When you have an error your want to check just copy and paste your query into the SQL form (as above) replacing the $ variables with actual data.

It is the same as using or die(mysql_error()) at the end of your queries in your PHP but just done within the database itself so can sometimes be a bit quicker and easier for testing/debugging.

simplypixie 123 Posting Pro in Training

I just thought I would re-iterate something that I have mentioned a few times in my replies to threads on here in that if your code isn't working, one of the first things to do is actually test your query in the database (i.e. through phpMyAdmin).

The reason I am posting this is that even though I have advised people quite a few times to do this, I had a problem the other day with some very simple coding and very basic update query and I just couldn't work out what the problem was - there was no logical reasoning for it not to work.

Eventually I decided to test the query in phpMyAdmin and guess what, I got an error and I resolved the problem - just a silly missing comma between the 2 fields and values I wanted to update.

The moral of the story: Firstly I should follow my own advice:) and secondly please test your queries in the database - it can save you a lot of time, head scratching and save your sanity.

pritaeas commented: Agree, although it won't happen... +14
simplypixie 123 Posting Pro in Training

Why not just echo out $_POST as that is all you are trying to do anyway. Otherwise, if you want to store the age in a session, you need to allocate your posted age to a session variable and to do that you need to do:

session_start();
$_SESSION['age'] = $_POST['age'];
echo $_SESION['age'];
simplypixie 123 Posting Pro in Training

Simply like this:

<?php 
 $query="SELECT location,id FROM area";
$result = mysql_query ($query);
echo '<select name="location_id">';
echo '<option value="">Please Select..</option>';
while($nt=mysql_fetch_array($result)){
echo '<option value="'.$nt['id'].'">'.$nt['location'].'</option>';
}
echo '</select>'; 
 
 ?>
manc1976 commented: Thanks for helping ... again ! +1
simplypixie 123 Posting Pro in Training

Also, you should not be using an </img> closing tag - there is no such thing. It should be:

echo "<div class='images_thumb'><a href='http://pashtoaudio.com/tahir_upload/".$show_img."'><img src='/tahir_upload/".$show_img."' /></a></div>";
simplypixie 123 Posting Pro in Training

A quick and dirty solution to show you how it can be done:

<?php
$sql = mysql_query("SELECT access_id FROM user WHERE id='".$userid."' LIMIT 1");
$result = mysql_fetch_array($sql);
$id = $result['access_id'];

$query = mysql_query("SELECT * FROM access");
?>
<select name='access'>
  <?php
    while ($accessrow = mysql_fetch_array($query)) {
  ?>
<option value="<?php echo $accessrow['id']; ?>" <?php if ($id == $accessrow['id']) { echo 'selected'; } ?> ><?php echo $accessrow['access']; ?></option>
<?php } ?>
manc1976 commented: Was the soulution I was looking for +0
simplypixie 123 Posting Pro in Training

Are your $_GET variables being populated?

Have you tested the query in PHPMyAdmin with actual values to make sure it is working?

Your filename=$f has no quotes around the $f.

simplypixie 123 Posting Pro in Training

It is good to use existing class attributes to help you learn but only if you take the time to understand them and what they are doing so that in future you can create your own.

simplypixie 123 Posting Pro in Training

There is also nothing to submit the form, you need a Subit button

diafol commented: doh! +14
simplypixie 123 Posting Pro in Training

Sorry, I put the wrong URL in - it should have been teamtreehouse.com and they offer tutorials in all aspects of website design and development, plus exercises to 'earn badges' so they do provide what you are asking for.

simplypixie 123 Posting Pro in Training

I was just going to say - I have run and tweaked your query and got it to work. It didn't like the as FeeID and as XLABEL so I changed those to all lower case and got the result as expected (using CURDATE()).

So the code (which is a bit more simple than what you have finished with) is:

SELECT count(TaskID) as taskid, date_format(TaskDueDate, '%d.%m.%Y') as xlabel FROM tasks WHERE TaskDueDate = CURDATE() AND Completed = 'No'
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

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

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.