Search found 16 matches

by tiger
Tue Oct 29, 2013 10:08 pm
Forum: PHP coding => General
Topic: Warning: mysqli_error() expects exactly 1 parameter, 0 given
Replies: 1
Views: 4122

Re: Warning: mysqli_error() expects exactly 1 parameter, 0 g

Sunny, 1- I see that your database name is 'test', and you did not put that in your $sql variable. 2- you're missing a ' ' around the $phone variable. So, try this code and see if it fixes the problem. $sql="INSERT INTO `test`.`registeration` (`fname`, `email`, `password`, `phone', `dob`, `gender') ...
by tiger
Mon Oct 28, 2013 2:01 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3792

Re: Insert record in PHP

Sorry, it is so long since I have formatted dates this way (i.e. without using the inbuilt php datetime class) that I forgot that if you use slashes in a date that strtotime will see it as a US date format and therefore will think your format of dd/mm/yyyy is actually mm/dd/yyyy and therefore retur...
by tiger
Mon Oct 28, 2013 12:32 am
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3792

Re: Insert record in PHP

You cannot store dates as dd-mm-yyyy in the database as the database date format is yyyy-mm-dd. Therefore you need to convert dates from dd-mm-yyyy to yyyy-mm-dd before you insert or update your db and vice versa to display the date in your required format when displaying. Based on the way you are ...
by tiger
Mon Oct 28, 2013 12:30 am
Forum: PHP coding => General
Topic: cron jobs
Replies: 2
Views: 973

Re: cron jobs

the cron.txt does not execute. I asked the webhost and they said they support it, however, when I used the cron jobs from the webhost C-Panal, it still does not work. I told them that, but they still say it's working. The cron.php file works just fine, and I get email when I go the url of cron.php S...
by tiger
Mon Oct 28, 2013 12:03 am
Forum: PHP coding => General
Topic: $_PHP_SELF
Replies: 2
Views: 3149

Re: $_PHP_SELF

For my understanding, it means that the webpage will submit to itself no matter what the file name is. so with the $_PHP_SELF you can put the php code inside the webpage (like what you did in your other post) not in another file, but the extension has to be .php NOT .html
by tiger
Sun Oct 27, 2013 11:50 pm
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3792

Re: Insert record in PHP

ok good I'm not sure about the date. You may want to check on the date() function here http://php.net/manual/en/function.date.php as for the difference between = and == = means that you assign a variable. For example: $name = "Tiger"; here I assigned Tiger to the $name variable. == means equals to s...
by tiger
Sun Oct 27, 2013 11:09 pm
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3792

Re: Insert record in PHP

check this one

Code: Select all

if($_POST['emp_name'] = "")
it should be

Code: Select all

if($_POST['emp_name'] == "")
if that did not fix it, then sorry for not being able to help :)
by tiger
Sun Oct 27, 2013 10:43 pm
Forum: PHP coding => General
Topic: Insert record in PHP
Replies: 23
Views: 3792

Re: Insert record in PHP

Hello Sunny

I think you forgot to put the `` before and after the table name

try this :

Code: Select all

$sql="INSERT INTO `emp_master` (`emp_name`, `emp_age`, `emp_dob`, `emp_email`) VALUES ('$emp_name','$emp_age','$emp_dob','$emp_email');";
by tiger
Sat Oct 26, 2013 8:52 pm
Forum: PHP coding => General
Topic: cron jobs
Replies: 2
Views: 973

cron jobs

Hello guys I have some problems with the cron jobs. I used these two lines in my (cron.txt) file: MAILTO=myemail@gmail.com 1 0 * * * * php -f /home/my_user_name/public_html/cron.php (note: I got this syntax from the web host) "php -f /home/user_name/public_html/cron.php" and in my (cron.php) file: <...
by tiger
Sat Oct 26, 2013 8:43 pm
Forum: PHP coding => General
Topic: ideas of sending emails reminding users of some stuff
Replies: 4
Views: 1569

Re: ideas of sending emails reminding users of some stuff

Thanks again John

I built a database and used it for that. Thanks for your advice. :D
by tiger
Mon Oct 07, 2013 10:47 pm
Forum: PHP coding => General
Topic: ideas of sending emails reminding users of some stuff
Replies: 4
Views: 1569

Re: ideas of sending emails reminding users of some stuff

for your code to remmeber these sort of things, you should either have a database/table or a file. Thanks johnj! The file is a great idea! I was thinking if I store the data into an array, would that work too? I'm not really sure of the way to do it, but I was just searching for info about it. like...
by tiger
Sun Oct 06, 2013 12:39 am
Forum: PHP coding => General
Topic: ideas of sending emails reminding users of some stuff
Replies: 4
Views: 1569

ideas of sending emails reminding users of some stuff

Hey everyone, Is there a way that I can send regular email reminder for all the users registered in the website without having a database? For example, let's say I have a website that asks people to enter some special days and their email, and then like every month, they get an email as a reminder t...
by tiger
Sat May 26, 2012 8:53 am
Forum: Your Scripts
Topic: Hi! Please little help: 1 form/1cell - more results!
Replies: 0
Views: 1383

Re: Hi! Please little help: 1 form/1cell - more results!

The goal is to appoint a different text value to each variable!
If I understood you correctly, this should be like this.

Code: Select all

$name1 = "Value1";
$name2 = "Value2";
$name3 = "Value3";
$name4 = "Value4";

Is that what you mean?
by tiger
Sat Jul 16, 2011 5:41 pm
Forum: Your Scripts
Topic: login and session questions
Replies: 5
Views: 1828

Re: login and session questions

egami wrote:just to add one more thing.

whenever you have an IF statement, it's a good idea to set a trap! Especially for development.

ie.

if (isset($submit)) {
do this stuff here..
} ELSE {
do this to show me that it doesn't exist
}
That's a good technic to keep in mind, egami! Thanks a lot man!
by tiger
Sat Jul 16, 2011 5:36 pm
Forum: Your Scripts
Topic: login and session questions
Replies: 5
Views: 1828

Re: login and session questions

Thanks a lot guys!! I got this to work two days ago! I wanted to show what I did here just in case anyone here has faced/will face the same problem. So, what I did for the first problem was that I added the SESSION instead of POST, and this is the code <input type="text" name="username" maxlength="2...
by tiger
Mon Jul 11, 2011 2:25 pm
Forum: Your Scripts
Topic: login and session questions
Replies: 5
Views: 1828

login and session questions

Hello everyone, I have some questions about these codes. I've been trying to get them to work, but I could not. First of all, the input tag, if the user inputs a wrong input, I want to keep the info they input and show an error. I tried this, but it did not work <label>Username</label> <input type="...