robert_gsfame
Members-
Posts
876 -
Joined
-
Last visited
Everything posted by robert_gsfame
-
i already set my table's column in varchar format........ hmmmm....what's the problem with the code huh?? How come the result always 01/1970
-
okay this is the detail of the code... i have a form <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form1" id="form1"> <?php <select name="month" id="month"> for($i=1;$i<13;$i++){ echo "<option value=$i>$i</option>";}?> </select> <select name="year" id="year"> <?php $annum=date("Y"); for($i=1900;$i<=$annum;$i++){ echo "<option value=$i>$i</option>";}?> </select> <input type="submit"> ONCE POST--> $keepyear=date("m/Y", strtotime($_POST['month'].'/'.$_POST['year'])); THEN RECORD INSERTED INTO MYDATABASE * the problem is occured when i retrieve the record from my table as it always give me the value of 01/1970 although i choose 05/1930 * When i keep the record without converting the date using strtotime, i will get the value of 5/1930 which is the correct answer (This means something wrong with the converted string, is that right??)
-
yup, i've tried what you've said but it didn't work either Just want to tell you that i set up a table's column in VARCHAR format
-
if (strcmp($sstring1, $sstring2) what is the default value for this?? less than 0,0 or greater than 0 anyway i use if(!(strcmp(case1,case2)){ echo "SELECTED" in order to retrieve the value from the database into my list menu and for sure it works Can you explain this to me
-
I just want to get more explanation regarding strcmp What i know is that using strcmp will return value 0,1, or 2 So what does this syntax actually mean if(!(Strcmp(case1,case2)){ echo "blabla" can anyone tell me ?
-
So confusing, what's wrong with this ?? <?php if(isset($_POST['check'])){ $getnumber1="No data";}else{ $getnumber2=date("m",strtotime($_POST['month']))).'/'.$_POST['year']; echo $getnumber2; } ?> And i don't get the month value being read, only the year.... (What i want to do is just to change the format from 1 to 01)
-
BRILLIANT Thebadbad!!! it runs !!! THX A LOT !!!
-
how to create a confirmation when link is clicked by user in php script in html, it works when i put this <a href="#" onclick="return confirm('Are you sure?')">link</a> but when i put it into my php script, it didn't run <?php echo "<a href='#' onclick='return confirm(Are you sure?)'>link</a>";?> can help me with this one
-
I need someone helps regarding uploading file... Is it possible to upload image inside let say registration form i used to do it like this ---- registration.php ----- <form name="frm_registration" method="POST" action="insert.php"> <a href="upload.php">Upload Image</a> <input type="submit"> ----- upload.php ---- <form enctype="Multipart/form-data" method="POST" action="registration.php> yeah i used to create upload.php apart from my registration.php can anyone help me, i actually want to make it in the same form which means inside my registration.php and also the way to insert the file itself into my database thx in advance
-
yeah i got it, i really don't realize that i could use OFFSET ha..ha thanks
-
hi guys, i have small problem related to mysql actually... I have let say 500 members for my site, then i would like to send them each an email while i can only send let say 100 in an hour which means i have to send them all in 5 hours each 100 email It's easy if i have my user id, i can just use below code: "SELECT * FROM mytable WHERE id between 0 and 101" -->1st 100 "SELECT * FROM mytable WHERE id between 100 and 201" -->2nd 100 "SELECT * FROM mytable WHERE id between 200 and 301" -->3rd 100 "SELECT * FROM mytable WHERE id between 300 and 401" -->4th 100 "SELECT * FROM mytable WHERE id between 400 and 501" -->5th 100 but the problem is that i don't have id for this user's table in my database..how do i have to retrieve my first 100, second 100, third 100, fourth 100 and fifth 100 every hour DOES ANYONE HAVE A CLUE FOR THIS??
-
thx, you've solved my problem.... i set password NVARCHAR(30) and it's not enough for hash :P Thank you so much!!
-
i have problem. i think it's simple but i don't why my script didn't work configuration.php --------------- <?php $local='localhost'; $user='user'; $pass='pass'; $dbase='mylogin'; mysql_connect($local,$user,$pass); mysql_select_db($dbase);?> index.php ------------------------- <form name="check" action="authenticate.php" method="POST"> <input type="text" name="user"> <input type="text" name="pass"> <input type="submit"> authenticate.php ------------------- <?php require_once('configuration.php');?> <?php $user=$_POST['user']; $pass=md5($_POST['pass']); $query="SELECT * FROM mytable WHERE user='$user' AND password='$pass'"; $mysql=mysql_query($query); $sql_num=mysql_num_rows($mysql); if($sql_num==1){ echo "login work"; } else { echo "Wrong Username or Password"; }?> can anyone give me some guide?
-
not working! :'(
-
I need someone helps.... i have textarea, (below is the code) <form method=POST name=form action=next.php> <input type=textarea name=textarea1> <input type=submit> </form> -------- next.php -------- $textarea=$_POST['textarea1']; if(empty($textarea)){ echo "wrong";}else{ echo "true";}?> the problem is that when i left the textarea empty, it still run echo"true" command....why does this happen??
-
[SOLVED] insert date and time into mysql
robert_gsfame replied to robert_gsfame's topic in PHP Coding Help
Thx for your help...Finally, i've found out what makes this error! Wrong parameters name -
You can work with your div inside <head>, like this: <head> <style="text/css"> #div3{ position:absolute; left:15px; top:19px; width:23px; height:32px; } <style> </head> <body><?php echo "<div id=div3></div>";?></body> hope this is what you're lookin for
-
[SOLVED] insert date and time into mysql
robert_gsfame replied to robert_gsfame's topic in PHP Coding Help
okay i've changed it but still give me the same result.. Do i have to change the format of the date?? it's easier to have it in VARCHAR format, but yet it will create new problem as i want to sort the records based on datetime -
Small things, but really difficult to find the error........ i have my column inside table --> date(datetime) the problem is that once i try to insert the date using: $date = date("YYYY-mm-dd H:i:s"); $query = "INSERT INTO xxxxxx(date)VALUES('$date'); $results = mysql_query('$query'); why does the date column still (0000-00-00 00:00:00) , although the other columns have been inserted which means i don't get any problems with the connection
-
yeah i know..i've put the submit button, once clicked then it goes to failed.php although i've made a condition using IF
-
if((!empty($_POST['title'])) && (!empty($_POST['text']))){ $check="success.php";}else{ $check="failed.php";}?> <form method = "post" action="<?php echo $check;?>"> Which part is wrong as i always go to failed.php although both text and title are not empty i've tried with !isset but it didn't work either...need someone suggestion.. Thanks in advance
-
i was wondering on how to create richtexteditor for my small discussion forum. Does anyone can give me a clue or solution regarding this?
-
sorry wrong typed