-
Posts
1,216 -
Joined
-
Last visited
Everything posted by WebStyles
-
this is all you need: (except you need to specify the path to mysqldump correctly) $u = 'username'; $p = 'password'; $db = 'databasename'; system("/Applications/MAMP/Library/bin/mysqldump -u$u -p$p $db > test.sql");
-
your code works for me (replacing all addresses, of course). Check your spam box. echo all variables and check their values.
-
you're still going to need session_start(); in that file.
-
put session_start(); at top of file.
-
still the same problem... where does the ELSE come from? change this: if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION["myusername"] = $myusername; //copy $myusername to $_SESSION['myusername'] $_SESSION["mypassword"] = $mypassword; //copy $mypassword to $_SESSION['mypassword'] $_SESSION["country"] = $country; $_SESSION["state"] = $state; } header("location: login_success.php"); else { echo "Wrong Username or Password"; } to this: if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION["myusername"] = $myusername; //copy $myusername to $_SESSION['myusername'] $_SESSION["mypassword"] = $mypassword; //copy $mypassword to $_SESSION['mypassword'] $_SESSION["country"] = $country; $_SESSION["state"] = $state; header("location: login_success.php"); }else { echo "Wrong Username or Password"; }
-
MYSQL, SELECT id WHERE id DOES NOT EQUAL MULTIPLE VALUES
WebStyles replied to sloth456's topic in MySQL Help
DISTINCT is to grab unique values... -
you have 2 closing bracket after your ELSE statement, and none before... you have this: if(){ ... else{ ... } } you should have: if(){ ... }else{ ... }
-
because that script relies on 3 external files that you don't seem to have: config.php, opendb.php and closedb.php the error says: "No such file or directory"
-
"Do or Do not, there is no try" -- Yoda
-
yes, it's possible, and yes, I back up my databases. what I normally do is tar -czf the entire mysql folder. I actually have a cron tab set up to do this every day at midnight. you can do the same with php, or you could dump the database to a csv file.
-
there HAS to be a response, even if it's just an error in your logs. my guess is the connection. check your error logs to see what went wrong.
-
yep... lol. except my code will work and yours wont (you left the backticks)
-
change this: $query = "INSERT INTO `profs` (`rating`) VALUES (`rating`)"; to this: $query = "INSERT INTO `profs` (`rating`) VALUES ('$rating')";
-
Is it possible to transfer files to computer in lan using php?
WebStyles replied to merck_delmoro's topic in PHP Coding Help
if you can mount the network drive on the server, then all you need is copy($src,$dest); (as long as the share has the appropriate permissions) -
you place the if statement just like I showed you in my example. your_var_here needs to have the value you put into name="whatever" when you create your <select... box..
-
you need to add 'selected' like this: $select .= "<option value='$file' selected>$file</option>\n"; so, basically, when you're looping through and building the dropdown menu, you compare the value with the one that was posted, and add ' selected' if necessary: $select .= '<option value="'.$file.'"; if($_POST['your_var_name'] == $file) $select .= ' selected'; $select .= '>'.$file.'</option>';
-
Need help selecting values from a MySQL populated dropdown menu :)
WebStyles replied to manuelV's topic in PHP Coding Help
There's no way that code was working.... I've corrected a few things, but haven't tested it. (you should find out where your logs are and make a habit of checking them while coding, it will make your life easier) * comments in code: <?php include("config.php"); // localhost needs to be enclosed in quotes $con = mysql_connect("localhost",$username,$password); // added $con to mysql_select_db parameters mysql_select_db("frontstep",$con) or die( "Unable to select database"); // assuming this is correct, I have no way of knowing $sql1="SELECT clients.clientID,clients.clientName, workOrder.clientID FROM clients, workOrder WHERE clients.clientID = workOrder.clientID"; // added connection resource $result2 = mysql_query($sql1,$con); // also, no way of knowing if this is correct, although it seems a bit "MUCH" if all you want is the clientID $sql2="SELECT clients.clientID,clients.clientName, workOrder.clientID FROM clients INNER JOIN workOrder ON clients.clientID = workOrder.clientID WHERE workOrder.workOrderID = '$workOrderID'"; // added connection resource again $result3 = mysql_query($sql2,$con); $row = mysql_fetch_assoc($result3); $selectedID = $row["clientID"]; while ($row=mysql_fetch_assoc($result2)) { // just changed a few things and added $options.= before ' selected' $options.='<option value="'.$row["clientID"].'"'; if($row["clientID"] == $selectedID) $options .= ' SELECTED'; $options.= '>' . $row["clientName"] . '</option>'; } ?> <select name="workOrderClient"><?php echo $options;?></select> try running this code and check your error logs! (if you're using mamp, xamp, or wamp, you'll have a folder somewhere in there called logs, if your on a linux server, check in /var/log or similar) -
maybe this will help you: http://www.phpclasses.org/package/1076-PHP-A-class-to-crop-images-in-a-variety-of-ways-.html (30 seconds on google and I got hundreds of pages with tutorials on how to crop images)
-
Need help selecting values from a MySQL populated dropdown menu :)
WebStyles replied to manuelV's topic in PHP Coding Help
use $_POST if your form method is post, $_GET if form method is get, and $_REQUEST if you're not sure. not needed here, because it's only 1 statement. $option is obviously a typo. should be $options -
echo this anywhere else in the code: echo '<script>setTimeout('delayer()', 5000);</script>';
-
well if the <body> tag is inside header.php, put <body onLoad="setTimeout('delayer()', 5000)"> inside header.php and remove from main file.
-
what code is in header.php ?
-
what do you mean? where does header.php come form, what code is in it?