Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. How can we help you if you don't post accurate information? where does the filed `status` come from? please post the complete database structure, with all the accurate names, and tell us EXACTLY what you are trying to do... you said: What does this mean? 1. you want to select all `uid` values from both tables 2. only the ones that exist in both tables 3. only the ones from table Friends that also exist in friends_invitations ??? You are not specific enough.
  2. database is called "polish", and I expect your host is 'localhost'... Try this. Don't forget to change the username and password to access your database <?php $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username="usename"; // Mysql username $password="password"; // Mysql password $c = mysql_connect ("localhost","$username", "$password") or die ("cannot connect"); mysql_select_db("polish",$c) or die ("cannot select DB"); $query="INSERT INTO `opi` (`raekke`, `modelnr`, `navn`, `priser`, `display`, `bruger`, `salg`, `usedup`, `instock`, `totaltstock`) VALUES ('$raekke','$modelnr','$navn','$priser','$display','$bruger','$salg','$usedup','$instock','$totaltstock')"; $result = mysql_query($query,$c) or die ('error updating databasen'); @mysql_close($c); if ($result){ header("location:polish.php"); } ?>
  3. can you print the whole page so I can see the table name and the database name (at the top and side) please?
  4. try this: SELECT friends.uid, friends.status FROM friends LEFT JOIN friends_invitations ON friends.uid = friends_invitations.fid WHERE (friends.uid = 2 OR friends_invitations.fid = 2) can you post your database structures with field names please?
  5. something like: $output = ''; foreach($new_array as $line){ $output .= implode("|",$line)."\n"; } fputcsv($fp, $output);
  6. if you don't know your host name or your database name, i give up.
  7. ???? mysql_connect ("THIS NEEDS TO BE YOUR HOST NAME","$username", "$password") or die ("cannot connect"); (probably 'localhost') mysql_select_db("THIS NEEDS TO BE YOUR DATABASE NAME",$c) or die ("cannot select DB");
  8. your database is called database? <? $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username="usename"; // Mysql username $password="password"; // Mysql password $c = mysql_connect ("hostt","$username", "$password") or die ("cannot connect"); mysql_select_db("database",$c) or die ("cannot select DB"); $query="INSERT INTO `opi` (`raekke`, `modelnr`, `navn`, `priser`, `display`, `bruger`, `salg`, `usedup`, `instock`, `totaltstock`) VALUES ('$raekke','$modelnr','$navn','$priser','$display','$bruger','$salg','$usedup','$instock','$totaltstock')"; $result = mysql_query($query,$c) or die ('error updating databasen'); @mysql_close($c); if ($result){ header("location:polish.php"); } ?>
  9. remove the word 'desc' from the query.
  10. well, if the problem are not the missing quotes (I guarantee that was ONE of the problems)... since you only gave us one line of code, how are we supposed to fix the rest ?
  11. in that case, why not create the excel file for him ? (the less uses have to do anything, the more they'll like your website)
  12. change these 3 lines: mysql_query($query) or die ('error updating databasen'); mysql_close($query); if ($query) to: $result = mysql_query($query) or die ('error updating databasen'); mysql_close(); if ($result) and try again
  13. you have a row called row? that sounds weird and it's probably a mysql reserved name. try this, but replace TABLE with your table name, and ROW with your row name (leave the backticks) $result = mysql_query("select * from `TABLE` order by `ROW` desc");
  14. this: header("location:polish.php"); (like you have it in your bottom script) should work fine. the problem must be with if($query)... if the condition isn't met, your page will not redirect. I'm guessing you have some problem with the database connection or query.
  15. can you post an example of what you want your .csv file to look like?
  16. missing double quotes: $date = date("Y-m-d");
  17. it's not really the same thing. I set up my own servers, so I actually have root access to the entire machine. First you need to check if you have any way of setting up cron tabs (in cpanel, or whatever other administration system they provide) then you need to know exactly where your database folders are... then all you need is to set up a cron tab with something like: tar -czf /path_to_BACKUP_FOLDER/filename_`date +%d-%m-%Y`.tgz /path_to_MYSQL_FOLDER and schedule it to whatever time of the day / days of the week you want
  18. as I said before, I use cron tabs and a simple shell script to compress the entire folder. I only work with linux and macintosh, you're using windows.
  19. please post the code you already have, and a list of the errors / output you're getting.
  20. you found this path: C:\Program Files (x86)\EasyPHP-5.3.6.0\mysql\bin\mysqldump.exe then you used this one: C:\Program Files (x86)\EasyPHP-5.3.6.0\mysql\bin\mysqldump See what's wrong there?
  21. I gave you the answer. If you can't find the path to your mysqldump, google won't help you much.
  22. what are you using? Xamp, Mamp, Wamp? on Windows, Linux or Macintosh ?
  23. $names = array('Internet','Yellow pages','Van','Letting agent','Repeat customer','Recommendation'); // assuming you have a var called $dbValues with the results from database and that it looks like this: 0|1|3 $dbNumbers = explode("|",$dbValues); $n = array(); foreach($dbNumbers as $num){ $n[]=$names[$num]; } echo implode(", ",$n);
  24. the you didn't do it properly. that EXACT same script worked for me. read my previous post again and locate where you mysqldump is, then replace the path with the correct one. this: /Applications/MAMP/Library/bin/mysqldump will only work if you're on a Mac using Mamp. You need to specify YOUR path.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.