DoddsAntS
Members-
Posts
34 -
Joined
-
Last visited
Never
Everything posted by DoddsAntS
-
have a try of the following <?php $day=date("j"); $sql="SELECT * FROM invoices WHERE day='$day'"; $query=mysql_query($sql) or die($sql.mysql_error()); if(mysql_num_rows($query) > 0) { while ($req=mysql_fetch_array($query)) { if(mail($req['UserEmail'], "You must pay for protection.", "You haven't paid for protection. You have one day to pay or god may strike down your building.")) { echo "Sent email to {$req['UserEmail']}\n<br />\n"; } else { echo "Failed to send email to {$req['UserEmail']}\n<br />\n"; } } } else { echo "No results!"; } ?> Regards, A
-
[SOLVED] Script will not connect to MySQL -- Why?
DoddsAntS replied to dogfighter's topic in PHP Coding Help
The connect function in the mysql class doesn't return any value so the line $mysql->connect() or die("error" . mysql_error()); is the reason, the connect function already has error handling in it so why add this when calling the connect function ? if you remove the or die(...blah..) from the above line it should be fine, alternately you could rewite the connect function so it returns a value -
Hi, The code that you first posted contains the call to the mail function, is that page called online_application_confirmation.php ? You mentioned that the page redirects to a confirmation page which is the code snippet above ? this page does not have any call to the mail function in it The way your doing error checking to see if the mail has been sent in the first page is incorrect. Possible solutions to your problem are to. 1. move the call to the mail function to the page online_application_confirmation.php this should send the email out to you if it's configured correctly 2. change the form action to be the page the form is on and then do a redirect after the mail function call (on a successful mail out or show the form again) Regards, A
-
you haven't closed while block in the accept case
-
Form not getting set with PHP all fields return empty
DoddsAntS replied to progwihz@yahoo.com's topic in PHP Coding Help
there is an error in the following line. <form class="appnitro" enctype="multipart/form-data" action="<?php echo htmlentities($_SERVER['PHP_SELF');?>" name="addVideoGameForm" method="post" > it should be <form class="appnitro" enctype="multipart/form-data" action="<?php echo htmlentities($_SERVER['PHP_SELF']);?>" name="addVideoGameForm" method="post" > -
Hi, Try using the file system path to the file instead of the url to the file so replace http://hypboard.com/thehyp/generalnews.txt with /home/hypboard/public_html/thehyp/generalnews.txt
-
the variables aren't accessible inside your login function. I would suggest moving the mysql_select_db outside of the function and passing the connection var as a function argument
-
If my record is null, Can i show that column to N/A
DoddsAntS replied to xubi's topic in PHP Coding Help
Hi, Just to add a bit of checking that would fill most situations Phone numbers may contain alternate characters so the is_numeric function will return false positives so I would use the following <td>Phone : </td><td><?php echo is_null($Num) ? 'N/A' : $Num;?></td> -
[SOLVED] Few problems, explained in detail i think :)
DoddsAntS replied to xoligy's topic in PHP Coding Help
Hi, What are the field details for the mid field ? -
Hi, Have a look at the header() function A
-
Hi, Here is one way 1. Read file 2. create an array for ids and for duped ids 3. Loop through ids 3a. Check to see if id is in array of id's if not add it if it is check to see if its in the duped id array if not add it 4. Echo out the ids from the duped id array Hope this helps a little
-
Hi, Try something along the lines of SELECT * FROM table2 INNER JOIN table1 on table2.email=table1.email and take a look at Data Join Tutorial
-
[SOLVED] Fatal error: Function name must be a string
DoddsAntS replied to unkwntech's topic in PHP Coding Help
No worries, I do the same quite regularly A -
Hi, in the echo statments your using single quotes, this wont do the variable substitution you want so use the following instead <?php echo "<img src='http://www.domain.com/images/{$file}'>"; ?> or <?php echo "<img src=\"http://www.domain.com/images/{$file}\">"; ?> or <?php echo "<img src='http://www.domain.com/images/" . $file . "'>"; ?> A
-
[SOLVED] Fatal error: Function name must be a string
DoddsAntS replied to unkwntech's topic in PHP Coding Help
Hi, you could try removing the $ from the front of the dtae function, that may help A -
Updating multiple rows in mysql...how to add a checkbox!
DoddsAntS replied to Benbo1980's topic in PHP Coding Help
Yeah, you'll need to change the update query -
Updating multiple rows in mysql...how to add a checkbox!
DoddsAntS replied to Benbo1980's topic in PHP Coding Help
Hi, Here are a few things for you to think about if you click 4 check boxes your ONOFF array will look like this ONOFF[0] = 1 ONOFF[1] = 1 ONOFF[2] = 1 ONOFF[3] = 1 This is why the system is setting the first x records to be 1 where x is the number of boxes you check. Any records that you have been set to on previously will stay as 1 I would recommend setting the value to be the id of the record you want to update as you only have an on or off value for the field. A -
Hi, Take another look at the substr() function specifically the 3rd parameter A
-
Almost, something like $time = date("Y-m-d H:i:s", strtotime("-2 mins")); will give you the correct format for the timestamp
-
okay, take a look at mktime() function strotime() function date() function you want to make a time stamp that is x mins in the past and check for lastactive times greater than that, you'll need to format the timestamp so it displays like the mysql timestamp.
-
Do the filtering in the query, that way you dont have to loop through all the rows, are you using a unixtime stamp or a date/time stamp ?
-
Hi, Add some filtering to your query (Where clause). if you have any issues post again but try first
-
Hi, Have a look at the strtotime() function use this in the where clause of your query, and for formatting the date have a look at the date() function A