simplypixie 123 Posting Pro in Training

I mean where is the $_GET, that is what I was trying to ask the poster - where is the value for the $id variable being obtained from.

simplypixie 123 Posting Pro in Training

I agree, but where is it??

simplypixie 123 Posting Pro in Training

Use View Source on your form page to check that there is a value for the hidden id field as $_POST will work as long as there is a value to post.

In fact, where are you getting the value for $id from anyway to use in your query in the first instance as I can't see any reference to it at all in your code?

simplypixie 123 Posting Pro in Training

It means that the page will load before your javascript tries to run - better for page load time and the same as you should use document.ready() function in javascript coding so that the server doesn't try to run javascript that is related to content in the page before the page has loaded.

I really suggest you Google for some basic Javascript tutorials to learn about the basics of how it works and how to use it before trying to implement it in your own web pages.

simplypixie 123 Posting Pro in Training

Exactly:)

simplypixie 123 Posting Pro in Training

No, that is already a link to an external script so leave it as it is and move it to the bottom of your page with all the other script links.

simplypixie 123 Posting Pro in Training

Just copy your inline scripts to a new file, save it as as .js file and link to it the same way your other javascript files are linked.

So, for example, take your first bit of inline code

$(function(){
$('#loopedSlider').loopedSlider({
autoStart: 6000
});
});

Paste it into a file and save that file in your js folder as autoload.js (or whatever you want to call it).

Then link to it as such

<script type="text/javascript" src="js/autoload.js"></script>

Remember to remove the code that you have saved into a new js file from your page

simplypixie 123 Posting Pro in Training

OK, put all of your links to your external js files (including the ones you will be creating) at the bottom of your page before the body closing tag

<body>
// all your HTML here
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="js/loopedslider.js"></script>
<script type='text/javascript' src='js/menu.js'></script>
<script type='text/javascript' src='jquery-1.2.3.min.js'></script>
</body>
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

No problem:)

Please mark your thread as solved.

simplypixie 123 Posting Pro in Training

Is delete an inbuilt function in mysqli so you can't use it as a column name?

simplypixie 123 Posting Pro in Training

The columns in your query and the syntax error don't match - where is member_type='none' come from?

simplypixie 123 Posting Pro in Training

The first thing I would do is move all your scripts out into external js files and load them into your page rather than having them inline. Then the second thing would be to place them just before the closing body tag so that your page loads before you try and load/call the js files.

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

What format are you expecting to get from your strtotime and what format are you using in your database for the date columns?

Also you original date format should be 13/12/2011 not 12/13/2011.

simplypixie 123 Posting Pro in Training

Sorry, it is just the way I code so I automatically put it in and you are correct I could have just amended the ORDER BY

simplypixie 123 Posting Pro in Training

You are missing your join functionality (not sure what where clause you want to use or which table dateposted belongs to):

$sql = "SELECT entries.*, catagories.cat FROM entries INNER JOIN catagories
ON entries.cat_id = catagories.id
ORDER BY entries.dateposted DESC
LIMIT 1;";
simplypixie 123 Posting Pro in Training

Are you saying you only want to display the .51 part of the string 25.51?

simplypixie 123 Posting Pro in Training

You can't have spaces in your column names, so purchaser telephone needs to be something like purchaser_telephone (at the moment you are saying select purchaser.purchaser and then have a random word telephone afterwards)

simplypixie 123 Posting Pro in Training

No problem

simplypixie 123 Posting Pro in Training

Not a problem - glad to hear it is working for you now:)

simplypixie 123 Posting Pro in Training

Try setting the height of your body to the height of your background image and get rid of the background-size. Though for a set image background I personally would make a wrpper div to fit the body and put the css in their and leave the body to just have margin and padding set at 0.

simplypixie 123 Posting Pro in Training

You are trying to get results from an INSERT query - you also need a SELCT query after your INSERT query to load results into your mysql_fetch_array and while loop

mysql_query("INSERT INTO book_tbl (title)VALUES('".$_SESSION['title']."') ");

$my_query = "SELECT title FROM book_tbl";
    $result = mysql_query($my_query) or die(mysql_error());
   

     while($row = mysql_fetch_array($result,$con))

            echo $row['title'];
}
simplypixie 123 Posting Pro in Training

Please show the code in the function and where you are calling/using that function

simplypixie 123 Posting Pro in Training

I had tried something similar before but find that I end up with 01-01-1970 where I have '0000-00-00' in the datefield.
Some of the dates have not yet been input therefore I wish to retain them as 'nil'

With what I put, you will need to resolve this by using an if statement to ignore dates that are 0000-00-00.

simplypixie 123 Posting Pro in Training

I had tried something similar before but find that I end up with 01-01-1970 where I have '0000-00-00' in the datefield.
Some of the dates have not yet been input therefore I wish to retain them as 'nil'

With what I put, you will need to resolve this by using an if statement to ignore dates that are 0000-00-00.

simplypixie 123 Posting Pro in Training

Could really do with seeing the rest of your code (especially what you are doing before the piece of code you have already posted). However, as a start, you don't need 2 equals signs and you have put a semi-colon in your if statement which is incorrect, so should be

if (mysql_num_rows($replacing)!=0) { echo........; }

or you could use greater than:

if (mysql_num_rows($replacing)>0) { echo........; }
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

Use margin-top with a value of 300px minus top image height, minus bottom image height

simplypixie 123 Posting Pro in Training

Exactly as I said before - you have text in your HTML so you need to remove it if you don't want to see it or comment it out

simplypixie 123 Posting Pro in Training

You can use border-radius in CSS3 to create your rounded corners without an image - try this article http://www.css3.info/preview/rounded-border/

simplypixie 123 Posting Pro in Training

Sorry it still doesn't mean anything - the HTML you have used as an example means that you will have text on your webpage as that is what you have coded.

simplypixie 123 Posting Pro in Training

If you Google PNG in IE6 you will find solutions

simplypixie 123 Posting Pro in Training

You could do it in PHP instead (also you have to FROM table in your query which is wrong)

$query=mysql_query("SELECT * FROM table");
$result=mysql_fetch_array($query);
while ($row = $result=mysql_fetch_array($query)) {
$datefield = date('d-m-Y', strtotime($row['datefield']));
}
simplypixie 123 Posting Pro in Training

I can't remember which but some older versions of IE don't like PNG images and you need to use a workaround for them (I remember doing this with a couple of sites but it was a couple of years ago so can't remember how) - that may be your problem.

simplypixie 123 Posting Pro in Training

Is there any script on site.php that checks if a user is logged in or logging out that could redirect back to the logout page?

simplypixie 123 Posting Pro in Training

If somene orders 1 product:

mysql_query("UPDATE Product SET Quantity=Quantity-1 WHERE Id='".$id."'");

Replace $id with your variable name foe the product id and if someone orders more than 1 of the same product store the total number in a variable like $total and change Quantity-1 to Quantity-'".$total."'

simplypixie 123 Posting Pro in Training

Sorry but I am completely confused - exactly what text is showing up that you don't want to see??

simplypixie 123 Posting Pro in Training

Please edit your post and put your code into code tags so it can be read more easily.

simplypixie 123 Posting Pro in Training

You need to store the post selection of checkboxes in an array. So you would call your checkboxes all the same name and create an array from those selected.

name="nameofcheckboxes[value_id]"
simplypixie 123 Posting Pro in Training

You also need your post data in '' and either use {} or '".."' around them:

$upd="update news set title='".$_POST['title']."',date='".$_POST['date']."',post='".$_POST['post']."' WHERE id = '".$_POST['id']."'";
simplypixie 123 Posting Pro in Training

Please post your code so we can help

simplypixie 123 Posting Pro in Training

I would store your information in a database - much easier to work with if you want to use the number of clicks for anything in particular.

With regard to clicking on the image you would need to use either javascript with an onclick() event to count or send the user (without them knowing) to another page when they click the image and use this page to update the count and then database then forward to the actually image / image page.

simplypixie 123 Posting Pro in Training

If you want to display one row you need to either change your query to include a WHERE clause rather than selecting all of the records, or select all of the records and then use and IF statement to determine which row you want to display.

Using the ID as example:

$sql = "SELECT * FROM jobs WHERE id='".$id."'";

or

while($res = $result->fetchArray(SQLITE3_ASSOC)){
if ($res['id'] == $id) {
             echo "<table border=1>";
             echo "<tr><td>";
             echo $res['id'];
             echo "</td><td>";
             echo $res['jobtitle'];
             echo "</td><td>";
             echo $res['employer'];
             echo "</td><td>";
             echo $res['location'];
             echo "</td><td>";
             echo $res['email'];
             echo "</td><td>";
             echo $res['description'];
             echo "</td><td>";
             echo $res['date'];
             echo "</td></tr>";
             echo "</table>";
 }
 
          }
simplypixie 123 Posting Pro in Training

As cereal says, you need to actually run the query using mysql_query as follows:

$sql=mysql_query("SELECT * FROM $question WHERE question=$a");
		$query=mysql_fetch_array($sql);
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

I would try naming your variables differently, for example in the second query use $osql, $oresult, $oquery, $oid, and see if that helps.

simplypixie 123 Posting Pro in Training

Can you post your form code so I can understand what you are trying to do please

simplypixie 123 Posting Pro in Training

No problem and sorry I forgot to close the select tag (knew I had missed something but couldn't think what it was).