paul2463
Members-
Posts
955 -
Joined
-
Last visited
Never
Everything posted by paul2463
-
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.
-
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";
-
how to change value of a php session variable in javascript
paul2463 replied to sunil.23143's topic in Javascript Help
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 -
means that function display_value () { some code } does not exist
-
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>"; }
-
$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)
-
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.
-
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);
-
case is a mysql reserved word put back ticks around it `case` int(11)
-
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
-
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
-
echo date("r"); //Fri, 01 Aug 2008 12:57:07 +0100
-
[SOLVED] Major Problem Sending Email with PHP Mail()
paul2463 replied to DamienRoche's topic in PHP Coding Help
if it works please click "SOLVED" -
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???
-
Pass the $total and $quantity from my cart to the checkout page
paul2463 replied to lebexpress's topic in PHP Coding Help
$_SESSION['qty']=$quanty; if that is a direct copy from your code, it doesnt work because quantity is spealt wrong!!! -
you did it for all the rest so why did you not put single ticks around the last sessions variable? try $sql = "INSERT INTO topics(title, body, user_id) VALUES('" . $_POST['title'] . "', '" . $_POST['message'] . "', '" . $_SESSION['USERID'] . "')"; mysql_query($sql) or die(mysql_error());
-
[SOLVED] do you see problem with this if elseif statement?
paul2463 replied to ok's topic in PHP Coding Help
bretticus is correct the elseif statement is redundant change it ofr a straight else such as } } else { echo "<br><br>"; echo "<b>That number is already taken.</b>"; echo "<br><br>"; } -
[SOLVED] Parse error: syntax error, unexpected T_ENDFOREACH
paul2463 replied to GsXtAsY's topic in PHP Coding Help
you are missing a closing brace for your first if statement try changing these couple of lines <?php $nr++; endforeach; } else { ?> for <?php $nr++; } //closes the last if/else statement endforeach; // end your foreach statement } //end the first if statement prior to last else else { ?> -
[SOLVED] php read numeric values after text
paul2463 replied to liamthebof's topic in PHP Coding Help
<?php $string = "jlknlkj4223"; function getnumber($string) { $count = -1; for ($i = 0; $i <= strlen($string); $i++) { if(!is_numeric($string[$i])) { $count++; } } $return = substr($string,$count,strlen($string)); return $return; } echo getnumber($string);//prints out 4223 ?> -
it is telling you that $id does not exist
-
$query = "SELECT * FROM dvd ORDER BY dvd_id DESC"; $result = mysql_query($query) or die ("Error in query " . mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo "$row['name'] </BR>"; } echo "NEW";
-
[SOLVED] Need the line of code to delete an object
paul2463 replied to cleary1981's topic in Javascript Help
-
Have a look <a href="http://lists.evolt.org/archive/Week-of-Mon-20050214/169524.html"> Here </A>
-
then you have connected to the wrong database or the table does not in fact exist, i know oyu have posted the create table code, but has it been created inside the database you are calling it from?
-
this might seem a silly question but is the database you are trying to connect to called "mydbusername" or have you just not remembered to reset it to what the database is called???? or have you changed that bit for this forum??