Re: [PHP-DB] mysqldump via php
mysqldump is a .exe, and therefore it will not work within mysql_query(); You may be able to use mysqldump from PHP using the system function check out http://uk.php.net/system Ade Jeffrey wrote: I would like to do a backup of an entire MySQL database via php. My thought was to use mysqldump, write the data to a file and save the file. However... $query="mysqldump $dbase"; $result=mysql_query($query) or die(mysql_error()); ...immediately results in an "error in your SQL syntax near mysqldump [database name]". The reason I want to do a MySQL back up via php is that I have a web application in which the user can archive a project, which involves moving a lot data from one set of tables to another set of tables. The user can also delete a project, which removes lots of data from the DB altogether. Although there are lots of "Are you sure you really want to do this?" messages the user must click upon, I am sure I will eventually get a user telling me she accidentally archived/deleted stuff and can I help. So, my thought was to do a incorporate a mysqldump in the archiving/delete page. That way there would be a snapshot of the pre-action db, making it easy to put things right. Can you help with my query - or by suggesting an alternative solution? Thanks, Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PDF BLOB to Email
[snip] No, not "Obviously", PHP is not well suited for many tasks (or has a high cost to get the suit tailored) :) [/snip] "Obviously " because i am posting to a PHP list, numpty! but thank you for the recommendation anyway. JupiterHost.Net wrote: Adrian Bruce wrote: Hi Hello, I have pdf's stored as a blob in a MySQL database, how can i set a script (PHP obviously!) to email these blobs as pdf files. The only way No, not "Obviously", PHP is not well suited for many tasks (or has a high cost to get the suit tailored) :) If you branch out you'll find a whole world of alternatives that are easier to code and maintain server wise. All without the onslaught of PHP security vulnerabilities and performance bloats. i can think of at the moment is to write them to disk and then attach them to the mail before sending it. This doesn't seem that efficient but perhaps it is the only way?? Nope, its fine to attach it from a variable, in fact an example of how to do just that can be found at http://search.cpan.org/perldoc?Mail::Sender::Easy under the "EXAMPLE" header. you'd simply: my($pdf_guts) = $dbh->selectrow_array(q{SELECT pdf_guts FROM pdf_store WHERE id = '123'}); # http://search.cpan.org/perldoc?DBI PHP's mail() is a lame lame function with limited ability and even higher hackability, don't use it. HTH :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PDF BLOB to Email
Hi I have pdf's stored as a blob in a MySQL database, how can i set a script (PHP obviously!) to email these blobs as pdf files. The only way i can think of at the moment is to write them to disk and then attach them to the mail before sending it. This doesn't seem that efficient but perhaps it is the only way?? Any help greatly Appreciated Ade -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL creating new tables using wrong engine...
--default-storage-engine option in your options file (my.ini) where engine is the the type of table engine you want to use, in your case MYISAM. If you cant change that then specify the engine type every time you create a table: create table table_name{ . } TYPE=myisam; Regards Ade Mark Benson wrote: I have run into an issue where I keep getting InnoDB tables everytime I create a new table in PHPMyAdmin, and I want MyISAM tables. It's very annoying. Anyone got any suggestions as to what I might have done that made MySQL or PHPMyAdmin do this? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] css #2
Jerry Not a php related question at all for starters but anywayi think you need to read up on CSS layout's if the site is properly structure using CSS then you will not have much to worry about regarding different resolutions. Ever heard of floats? google will show you the light! Ade JeRRy wrote: Okay I did some more surfing, on a VERY popular website used by neally a million users. I checked their CSS and they use px and pt meassurements. So maybe that is not my issue than. Maybe I don't have an issue to worry about? What are people's thoughts on this, all the input the better here as I am creating a website that will be viewed by alot of people so want it readable by the majority. I know screen res of 600* is very old and few would use it, the site appears pretty big with it but things appears just about where it should. However when you try and view the copyright notice it cuts the last line out, what causes this? Would It be useful to add to breaks at the end? J Hi everyone, I have created this website in PHP and mySQL at http://www.bps-testntag.com/ but have come accross an error I was not aware of before. Now I am using stylesheets and I have been surfing the net for about 90 minutes and yet to find a solution, so thought I'd post here, could be basic but i can't find it online anywhere. Get alot of forum refrences but no solution. Here is the code below before I continue:html {background : url(images/background3.jpg); } body { margin : 0; padding : 0 1px; border : 0; height : 100px; background : url(images/background3.jpg); } body { font-family : arial, serif; font-size : 16px; } #page { margin : 310px 0 50px 250px; display : block; width : 500px; border : 1 solid #000; background : url(images/background3.jpg); padding : 10px; } #page .right { font-size : 30px; float : right; } #menu { display : block; top : 110px; left : 20px; width : 130px; position : fixed; border : 0; padding : 10px; text-align : center; font-weight : bold; color : #fff; } * html #menu { position : absolute; } #menu a:visited, #menu a { display : block; width : 120px; height : 20px; margin : 0 auto; border-top : 0 solid #fff; border-bottom : 0 solid #000; text-align : center; text-decoration : none; line-height : 20px; color : #000; } #menu a:hover { background : #aaa; color : #fff; } .clear { clear : both; } p:first-letter { font-size : 25px; color : #cc; } #fixpic { display : block; width : 108px; height : 145px; position : fixed; bottom : 0; left : 0; } * html #fixpic { position : absolute; } #adsie { position : absolute; top : 10px; right : 30px; } Now I have been told NOT to use "px" but use "%" for meassurements because this is relient on resolution/screen_size. HOWEVER what does 1px equal in %? Some have said 30px equals 3% and some say 30px equals 30%. 30px and 30% don't seem right, I changed my CSS for this and it pushes everything only slightly to the RIGHT. But removes the menu altogether. Can anyone offer some help here? Also if a table is made like this: Is that default % or px or what? What is the best method to use that will work in people using screens of 600* and 1024* and both be able to view the site cleanly and easily? I will continue to surf. J -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PDF generation on the fly
thanks a lot, i'll take a look at it Bastien Koert wrote: www.fpdf.org bastien From: Adrian Bruce <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] PDF generation on the fly Date: Mon, 23 Jan 2006 15:31:48 + Hi Do any of you use pdflib for generating PDF files on the fly? Ive got the demo working and it looks good so far, i was expecting it be open source but found out that it has a price tag of 450 euros per processor, this is fairly reasonable of course but i was wandering if anyone knew of any alternatives (prefereably open source) out there that do a similar thing. Thanks Ade -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PDF generation on the fly
Hi Do any of you use pdflib for generating PDF files on the fly? Ive got the demo working and it looks good so far, i was expecting it be open source but found out that it has a price tag of 450 euros per processor, this is fairly reasonable of course but i was wandering if anyone knew of any alternatives (prefereably open source) out there that do a similar thing. Thanks Ade -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SELECT
Possibility? WHERE (`date_created` = '$date_90_minutes_ago' AND `time_created` <= '$time_90_minutes_ago') or (`date_created` < '$date_90_minutes_ago' AND `time_created` > '01:30:00') Ade Ron Piggott (PHP) wrote: Yesterday I asked how to get the date & time 90 minutes ago and I received several responses. Thanks. I don't think this select statement is working "correctly". (Correctly being what I am intending it to do) I took a look at the table this morning. One record remains that was created 2006-01-19 at 23:55:37. These are the values of date_created and time_created. The current values are approximately 2006-01-20 and 05:50:00 This is the select statement I am writing about: SELECT * FROM `table` WHERE `date_created` <= '$date_90_minutes_ago' AND `time_created` <= '$time_90_minutes_ago' Intellectually I know the problem: 05:50:00 is much earlier than 23:55:37 ... thus my AND is not allowing both conditions to exist together. Is there a way that I may modify this SELECT statement so the present conditions continue to exist and add a second part to the SELECT statement that if the time is 01:30:00 or higher that records from the previous day are selected? This continues to allow the 90 minute time frame for users logged into my web site ... I am not sure how you would add an OR function to the above without messing up what presently works :) (I am writing a SESSION function for my web site using mySQL and a cron. The select statement I quoted above is part of the cron.) Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] formatting a date from mysql
farily straight forward to withinn the query itself, check out http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html or for php http://uk.php.net/date RTFM Regards Adrian Eternity Records Webmaster wrote: I need to figure out how to format the date format: year-month-day (2005-12-06). It is a date(8) field in a mysql table that i pulled out of the table with php 5.0.5. I need it in the format: Tue December 6, 2005 (or in mysql's formatting: 6-12-2005). I am using the reformatting for display only. So it would be something like this: echo $journal['Date']; //with whatever formatting needed If possible I need php to do the formatting for me. Thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Specific order by MySQL statement
Hi I am trying to get results from a MySQL query in a specific order, just using ASC or DESC will not work. For Example I have a field that can contain 4 possible values: 'Current', 'Completed','Withdrawn' or 'Transferred', I would like to order the results specifically like: Current Completed Withdrawn Transferred Is there any way i can do this using MySQL? Any help will be much appreciated. Thanks, Ade -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php