-
Posts
1,216 -
Joined
-
Last visited
Everything posted by WebStyles
-
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.
-
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
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"); } ?> -
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
can you print the whole page so I can see the table name and the database name (at the top and side) please? -
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
post your database structure -
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?
-
something like: $output = ''; foreach($new_array as $line){ $output .= implode("|",$line)."\n"; } fputcsv($fp, $output);
-
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
if you don't know your host name or your database name, i give up. -
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
???? 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"); -
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
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"); } ?> -
remove the word 'desc' from the query.
-
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 ?
-
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)
-
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
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 -
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");
-
help with header("location:polish.php"); i have problem
WebStyles replied to mus's topic in PHP Coding Help
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. -
can you post an example of what you want your .csv file to look like?
-
missing double quotes: $date = date("Y-m-d");
-
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
-
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.
-
PHP Date difference (conditional) in days.
WebStyles replied to inchirieri's topic in PHP Coding Help
please post the code you already have, and a list of the errors / output you're getting. -
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?
-
I gave you the answer. If you can't find the path to your mysqldump, google won't help you much.
-
what are you using? Xamp, Mamp, Wamp? on Windows, Linux or Macintosh ?
-
numbered array in database, need to show as text
WebStyles replied to jarv's topic in PHP Coding Help
$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); -
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.