Jump to content

paul2463

Members
  • Posts

    955
  • Joined

  • Last visited

    Never

About paul2463

  • Birthday 06/15/1966

Contact Methods

  • Website URL
    http://www.mot-forget-me-not.co.uk

Profile Information

  • Gender
    Not Telling
  • Location
    UK

paul2463's Achievements

Member

Member (2/5)

0

Reputation

  1. Because they are allowed to vote on many articles, you will need the 'VotedFor' table to bridge the 'many to many' gap between the 'users' and 'products' tables. IMHO you will have to take the hit on size.
  2. where is $headers initialised? the two lines above append data to the end of $headers, not initialise the variable try $headers = "Content-type: text; charset=iso-8859-1\r\n"; $headers .= "From:".$name." / ".$email."\r\n";
  3. PHP is a server side script, all variables are set at the server before being given over the the client Javascript is a client side script working with what it has been given to change a php variable and maintain it as a php variable then php server side has to do the change, hence you would have to pass it back to php, allow it to make the change and then pass it back to the client so in other words javascript cannot change the value of a php variable
  4. means that function display_value () { some code } does not exist
  5. why write it this way? not the answer to your question, just a coding question if (!fopen($File, "r")) { } else { echo $File . "<br>"; } why not just use if (fopen($File, "r")) { echo $File . "<br>"; }
  6. $query = "SELECT * FROM object WHERE object_name = '$result' AND proj_id = '$proj'"; //get all rows with this information $result = mysql_query($query) or die(mysql_error()); $count = mysql_num_rows($result); //count the rows returned, if it doesnt exist in the DB then it will be 0 if ($count == 0) { //for conditional checking it should be == (= assigns a value to a variable)
  7. the easiest way to do it it is to make the form go to another pure php page that does the inserting etc then when complete returns you to the main page, this will then clear the $POST variable and then it will not re-insert the same data.
  8. instead of using $query = "SELECT * FROM table where whatever"; mysql_query($query) or die ("Error in query" .mysql_error()); use $query = "SELECT * FROM table where whatever"; echo($query);
  9. case is a mysql reserved word put back ticks around it `case` int(11)
  10. you could write a javascript funcion such as this to do it for you function validateDate(var datestring) { var returnvar = false; if(parseDate(datestring)) //check to see if it is a valid date { var brokenDate=datestring.split(”-“); //break the datestring up if (brokenDate[0] > 2001) //check the year is greater than 2001 { //check months and days(max) here, if all good make returnvar = true } } return returnvar; } [/code not done all the coding but given you a start
  11. you problem is in here $query = "SELECT * FROM user WHERE username= $username"; $result = mysql_query($query); try using $query = "SELECT * FROM user WHERE username= '$username'"; //variables should have single ticks on them $result = mysql_query($query) or die ("error in query" . mysql_error()); //would tell you where the error is
  12. echo date("r"); //Fri, 01 Aug 2008 12:57:07 +0100
  13. print_r($_POST) should have printed out what is in the $_POST array, it will still fail in your query because nothing has changed - did oyu not get an echoed out result of the print_r() function???
  14. $_SESSION['qty']=$quanty; if that is a direct copy from your code, it doesnt work because quantity is spealt wrong!!!
×
×
  • 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.