Click here to Skip to main content
15,921,113 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: Fuzzy C Means in PHP Code and My SQL Database, Please Help! Pin
edrianhadinatazz18-Apr-11 19:38
edrianhadinatazz18-Apr-11 19:38 
GeneralRe: Fuzzy C Means in PHP Code and My SQL Database, Please Help! Pin
User 171649218-Apr-11 22:07
professionalUser 171649218-Apr-11 22:07 
GeneralRe: Fuzzy C Means in PHP Code and My SQL Database, Please Help! Pin
Smithers-Jones19-Apr-11 1:53
Smithers-Jones19-Apr-11 1:53 
GeneralRe: Fuzzy C Means in PHP Code and My SQL Database, Please Help! Pin
edrianhadinatazz28-Apr-11 17:31
edrianhadinatazz28-Apr-11 17:31 
Questioncheckboxes from hell Pin
Joan M13-Apr-11 4:24
professionalJoan M13-Apr-11 4:24 
AnswerRe: checkboxes from hell Pin
Graham Breach13-Apr-11 5:32
Graham Breach13-Apr-11 5:32 
GeneralRe: checkboxes from hell Pin
Joan M13-Apr-11 5:48
professionalJoan M13-Apr-11 5:48 
AnswerRe: checkboxes from hell Pin
Luc Pattyn13-Apr-11 6:11
sitebuilderLuc Pattyn13-Apr-11 6:11 
GeneralRe: checkboxes from hell Pin
Joan M13-Apr-11 6:33
professionalJoan M13-Apr-11 6:33 
Questionphp and div tags Pin
komanche12-Apr-11 23:52
komanche12-Apr-11 23:52 
AnswerRe: php and div tags Pin
enhzflep13-Apr-11 3:45
enhzflep13-Apr-11 3:45 
AnswerRe: php and div tags Pin
Mutinda Boniface15-Apr-11 3:44
Mutinda Boniface15-Apr-11 3:44 
QuestionMore of a poll than a question... Pin
Albert Holguin8-Apr-11 5:04
professionalAlbert Holguin8-Apr-11 5:04 
AnswerRe: More of a poll than a question... Pin
Nemanja Trifunovic8-Apr-11 5:20
Nemanja Trifunovic8-Apr-11 5:20 
GeneralRe: More of a poll than a question... Pin
Albert Holguin8-Apr-11 5:27
professionalAlbert Holguin8-Apr-11 5:27 
AnswerRe: More of a poll than a question... Pin
Slacker0078-Apr-11 7:04
professionalSlacker0078-Apr-11 7:04 
GeneralRe: More of a poll than a question... Pin
Albert Holguin8-Apr-11 7:26
professionalAlbert Holguin8-Apr-11 7:26 
GeneralRe: More of a poll than a question... Pin
Slacker0078-Apr-11 7:32
professionalSlacker0078-Apr-11 7:32 
GeneralRe: More of a poll than a question... Pin
Albert Holguin8-Apr-11 9:24
professionalAlbert Holguin8-Apr-11 9:24 
AnswerRe: More of a poll than a question... Pin
Paul Darlington14-Apr-11 5:11
Paul Darlington14-Apr-11 5:11 
GeneralRe: More of a poll than a question... Pin
Albert Holguin14-Apr-11 5:15
professionalAlbert Holguin14-Apr-11 5:15 
AnswerRe: More of a poll than a question... Pin
jschell14-Apr-11 9:52
jschell14-Apr-11 9:52 
GeneralRe: More of a poll than a question... Pin
Albert Holguin14-Apr-11 10:03
professionalAlbert Holguin14-Apr-11 10:03 
GeneralRe: More of a poll than a question... Pin
jschell15-Apr-11 8:58
jschell15-Apr-11 8:58 
Generaladd and show events on a calender in php/msql problem Pin
tryingmybest894-Apr-11 12:36
tryingmybest894-Apr-11 12:36 
Hi im trying to get my calender to display on the website but it is showing errors such as this:

Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'joeuser'@'localhost' (using password: YES) in C:\wamp\www\prog\addeventcal.php on line 8

Notice: Undefined variable: m in C:\wamp\www\prog\addeventcal.php on line 26 & 27 & 28

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\wamp\www\prog\addeventcal.php on line 29

here is my code. Can you please explain as to why it is not working. thank you

<html>
<head>
<title>Show/Add Events</title>
<head>
<body>
<h1>Show/Add Events</h1>
<?php
$mysqli = mysqli_connect("localhost", "joeuser", "YES", "testDB");

//Add any new event
if($_POST){
	$m = $_POST["m"];
	$d = $_POST["d"];
	$y = $_POST["y"];
	
	$event_date = $y."-".$m."-".$d." ".$_POST["event_time_hh"].";
	".$_POST["event_time_mm"].":00";
	$insEVENT_sql = "INSERT INTO calender_events(event_title, event_shortdesc, event_start) VALUES('".$_POST["event_title"]."';
	'".$_POST["event_shortdesc"]."', '$event_date')";
	$insEvent_res = mysqli_query($mysqli, $insEvent_sql)
					or die(mysqli_error($mysqli));
}
//Show events for this day
$getEvent_sql = "SELECT event_title, event_shortdesc,
				 date_format(event_start, '%l:%i %p') as fmt_date FROM
				 calender_events WHERE month(event_start) = '".$m."'
				 AND dayofmonth(event_start) = '".$d."' AND
				 year(event_start)= '".$y."' ORDER BY event_start";
$getEvent_res = mysqli_query($mysqli, $getEvent_sql)
				or die(mysqli_error($mysqli));
				
if(mysqli_num_rows($getEvent_res) > 0){
	$event_txt = "<ul>";
	while($ev = @mysqli_fetch_array($getEvent_res)){
		$event_title = stripslashes($ev["event_title"]);
		$event_shortdesc = stripslashes($ev["event_desc"]);
		$fmt_date = $ev["fmt_date"];
		$event_txt .= "<li><strong>".$fmt_date."</strong>:
		".$event_title."<br/>".$event_shortdesc."</li>";
	}
	$event_txt .= "</ul>";
	mysqli_free_result($getEvent_res);
}else{
	$event_txt = "";
}

mysqli_close($mysqli);

if($event_txt != ""){
	echo "<p><strong>Today's Events:</strong></p>
	$event_txt
	<hr/>";
}

//Show form for the adding event
echo "
<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">
<p><strong>Would you like to add an event?</strong><br/>
Complete the form below and press the submit button to add
the event and refresh this window.</p>
<p><strong>Event Title:</strong><br/>
<input type=\"text\" name=\"event_title\" size=\"25\"
	maxlenght=\"25\"/>
<p><strong>Event Discription:</strong><br/>
<input type=\"text\" name=\"event_desc\" size=\"25\"
	maxlength=\"25\"/>
<p><strong>Event Time (hh:mm):</strong><br/>
<select name=\"event_time_hh\">";
for($x=1; $x <= 24; $x++){
	echo "<option value=\"$x\">$x</option>";
}
echo "</select> :
<select name=\"event_time_mm\">
<option value=\"00\">00</option>
<option value=\"15\">15</option>
<option value=\"30\">30</option>
<option value=\"45\">45</option>
</select>
<input type=\"hidden\" name=\"m\" value=\"".$m."\">
<input type=\"hidden\" name=\"d\" value=\"".$d."\">
<input type=\"hidden\" name=\"y\" value=\"".$y."\">
<br/><br/>
<input type=\"submit\" name=\"submit\" value=\"Add Event\">
</form>";
?>
</body>
</html>

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.