AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
i like pie
-
cleaned up your code, try this.. <?php ini_set("error_reporting", E_ALL); ini_set("display_errors","ON"); // Connect To Database $dbhost = 'localhost'; $dbuser = 'database_user'; $dbpass = '***********'; $dbname = 'database_name'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error Connecting to MYSQL: '.mysql_error()); mysql_select_db($dbname); // End $backupFile = 'backup_folder/backup_file.sql'; $result = mysql_query("SELECT * FROM '$dbname' -> INTO OUTFILE '$backupFile'"); if($result) { echo "Database Backup Completed"; } else { echo "There Was A Error";} ?> do you receive any errors after you update you code?
-
http://php.net/manual/en/function.rename.php
-
1. your code needs cleaned up a bit... <?php require_once('../Connections/databaseconnect.php'); if(!empty($_POST['add']) && !empty($_POST['event']) && !empty($_POST['hour']) && !empty($_POST['minute']) && !empty($_POST['ampm'])) { $array = mysql_real_escape_string($_POST['add']); $title = mysql_real_escape_string($_POST['event']); $hr = mysql_real_escape_string($_POST['hour']); $min = mysql_real_escape_string($_POST['minute']); $am = mysql_real_escape_string($_POST['ampm']); $query = mysql_query("INSERT INTO `ade23566_event_timeline`.`template` ( `hour` , `minute` , `ampm` , `event` , `add_info` ) VALUES ( '$hour', '$minute', '$ampm', '$event', '$add' )"); if($query){ print "success"; }else{ trigger_error("Error:".mysql_error(),E_USER_ERROR); } } ?> 2. change your input names from arrays... "hour[]" to a string... "hour" as you will receive one value as it is
-
add the class to whatever tag you want it to be applied to..?
-
seems like the first suggestion did what you wanted it to, so you want to first sort by last name, then order them by date?
-
I think what he's talking about is the actual slideshow effect. Where either the pictures move fluidly in a right-to-left motion or it moves upon a mouse event. These types of UI can only be done with, yes, the cursed javascript. Unless of course you make it in Flash or Java. the cursed Flash or Java...
-
most designers are lazy..
-
first order takes precedence over the second order..
-
you think too much...
-
nice work so far..
-
We will need to see the code where you are passing the id through the URL. Please paste the code onto this thread. I'm mobile...
-
Are you checking to make sure $_GET['id] is set before executing your dependent code?
-
Maq =
-
My point exactly... Ha.. I just don't have time to do a walkthrough, although I encourage it.
-
okay, if you want to hold his hand, by all means, I don't have a problem with that...It's better to understand the code than to simply be given it....i agree
-
If statement inside query based on other table's data
AyKay47 replied to jimmyoneshot's topic in MySQL Help
to be honest im not familiar with that sql function either...fenway is the mysql man, however here is the documentation on correct syntax etc... http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_coalesce -
the error is being triggered because the $_GET['id'] value is empty...thus the query returns false....and actually all of the other errors that the OP are caused by the empty value as well
-
well the root of your issue is that your script is running as if $_GET['id'] has a value, even if it is not set, check to see if $_GET['id'] has been set first, then run the dependent code..
-
you are using a query value in $pilotid before actually calling the query.. $id = $_GET['id']; $sql = "SELECT * FROM pireps WHERE id=$id"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $pilotid = $row['pilotID']; //specify pilotid here $flightNum = $row['flight']; $departure = $row['dept']; $arrivalAirport = $row['arrival']; $hours = $row['flightTime']; $fuelUsed = $row['fuel']; $aircraftUsed = $row['aircraft']; $statusPirep = $row['status']; $pilotComment = $row['comment']; then your logbook.php should have the pid appended correctly
-
okay, $pilotid should be usable throughout the entire script since it is defined in the global scope...as to the reason your update query is not working, you have storing the "or die" part in your variable too, then trying to query that as well, should be written as such if ($errors == "") { $sql2 = "UPDATE pireps SET flight = '$flight', dept = '$dept', arrival = '$arrival', flightTime = '$flightTime', fuel = '$fuel', aircraft = '$aircraft', status='$status' comment = '$comment' WHERE id='$id'" $result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error()); header("Location: logbook.php?pid=" . $pilotid); } else {}
-
<?php $db = mysql_connect("removed credentials"); if (!$db) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $db); mysql_query("DELETE FROM users WHERE `signup_date` < DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); mysql_close($db); ?> there is no unexpected end here...
-
when you post code, the color coder can show you where you are messing up in your code mysql_query("DELETE FROM users WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)");