Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
$p = explode(':',$content); return $p[2]; One line...
-
If there's nothing scheduled for that date than it's going to have the default value... `e_event` varchar(50) NOT NULL default '', which is an empty string. So just check to see if the string isn't empty. if($row['event'] != '') { //add the link } else { //add the day but not the with the link }
-
k, moving to regex for further help.
-
If it matches a regex for a site, then surround it by tags, if not, don't. Do you need help with the regex?
-
This is your error: Means your query is failing. Change your code to this and tell me what it outputs (should be a MySQL error): $content = mysql_query($query) or die(mysql_error()); 'state', 'sectionid', and 'catid' are all integer types in your table right?
-
See if this works: Untitled Document </pre> <form action="serviceing.php" method="post" name="combo_box" id="combo_box"> em 1 2 3 4 5 6 7 8 9 10 11 12 13 14 </form> <br><br><br><br><br><br>/*subject and email variables*/ <br> $emailSubject = 'Test';<br> $webMaster = 'website2@affordablehomecare.org';<br><br>/*gathering data variables*/<br> $firstnameField = $_POST['firstname'];<br> $lastnameField = $_POST['lastname'];<br> $cityField = $_POST['city'];<br> $emailField = $_POST['email'];<br> $phoneField = $_POST['phone'];<br> $CfirstnameField = $_POST['Cfirstname'];<br> $ClastnameField = $_POST['Clastname'];<br> $CcityField = $_POST['Ccity'];<br> $stateField = $_POST['state'];<br> $ageField = $_POST['age'];<br> $sexField = $_POST['sex'];<br> $dateField = $_POST['date'];<br> $typeField = $_POST['type'];<br> $listField = $_POST['list'];<br> $extraField = $_POST['extra'];<br> $list = implode(', ', $listField);<br> <br><br>/*email field*/<br><br> $body = <br><hr> <br><br><h2>Contact Person</h2> <br><hr> <br>Contact First Name: $firstname <br> <br>Contact Last Name: $lastname <br><br>Contact City: $city <br><br>Contact Email: $email <br><br>Contact Phon Number: $phone <br><br><h2>Client Info</h2> <br><hr> <br>Client First Name: $Cfirstname <br><br>Client Last Name: $Clastname <br><br>Client City: $Ccity <br><br>Client state: $state <br><br>Client Age: $age <br><br>Client Sex: $sex <br><br>Date Service Is Needed: $date <br><br>Type Of Service: $type <br><br>Problems: $list <br><br>Extra Info: $extra <br><br>EOD;<br><br>/*email sender script*/<br> $headers = "From: $ct_email\r\n";<br> $headers .= "Content-type: text/html\r\n";<br> $success = mail($webMaster, $emailSubject, $body, $headers);<br> <br>/*resultes*/<br><br> $theResults = <br><br><title>Request Submitted</title> <br><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <br><br><br><p>it works!!!!</p> <br><br><br>EOD;<br>echo "$theResults";<br><br
-
I think desc is a reserved word. Put backticks around it. `desc`
-
You were using the resource id to echo the extracted rows. Try this: mysql_select_db($database_biosystem); $query_content = "SELECT title, introtext, created FROM jos_content WHERE state=1 AND sectionid=1 AND catid=1 ORDER BY ordering"; $content = mysql_query($query_content); while ($row = mysql_fetch_assoc($content)) { echo "".$row['title'].""; } ?>
-
Use something like: SELECT product, count(product) AS cnt FROM table GROUP BY product HAVING cnt > 1;
-
You can see if anything was returned with mysql_num_rows(). If it's greater than 0 then display the information, else display error message.
-
What was the problem?
-
I think burnside is a zombie.
-
Maybe a ternary? $test= (3
-
[SOLVED] php not always creating links, random per page refresh
Maq replied to viion's topic in PHP Coding Help
Care to share the solution? Was it because '$categorytitle' was empty? -
So this part sets correctly? And when you echo out $_SESSION['username'] it displays the correct user name from the POST but the other session variables don't echo out anything(aren't set)? $_SESSION['username'] = $username; Where do you actually echo out the session vars to see if they're set? What else outputs? We need some more information.
-
What happens, why do you think they're not being set? Do you have session_start() at the top of your script?
-
So what exactly do you want a list of? All the duplicate entries where all three fields match?
-
You assign $listField here: $listField = $_POST['list']; But never use it... So let's make it. You have to grab all the values from the array so, you can use what saok suggested and implode it together into a single string: $list = implode(', ', $listField); Also remember to give your options values. i.e.: 1 2 3 etc...
-
You also assign $listField but never use it...
-
None of your options have values. Please use tags when posting code.
-
There's no reason to go back up the tree. Just grab everything on the way down. What exactly are you using to grab the XML?
-
Not really... Have you read the PHPUnit Manual?
-
You need single quotes around $yes: $sql = "SELECT * FROM events WHERE date='$yes'"; If you put or die at the end of your query execution you would have seen this.
-
Did you provide a password for mysql_connect? It would be the last parameter in your function. I added some debugging lines in here. Run it and tell me the output, if any... ini_set ("display_errors", "1"); error_reporting(E_ALL); if(isset($_POST['submit'])) { $DBConnect = mysql_connect("localhost", "root") or die(mysql_error()); $var = isset($_POST['name']) ? $_POST['name'] : null; $delete = "delete from members where id = $var"; mysql_select_db("dietetics", $DBConnect) or die(mysql_error()); $result = mysql_query($delete) or die(mysql_query()); if (mysql_affected_rows() > 0) { echo "The row has been deleted, successfully"; } else { echo "No rows have been deleted"; } } ?> </pre> <form action="adminRegister.php" name="thisform" method="get"> <
-
If you have a linux server, otherwise you would do the equivalent of a cronjob for windows which is the 'task scheduler'.