AndyB
-
Posts
5,465 -
Joined
-
Last visited
Never
Posts posted by AndyB
-
-
Any way I could send you the file I have through email?
No thanks.
The way we all learn is by sharing knowledge. If you want to post some information about your database structure, and some information about what you want in the .csv file that will result from querying it and creating a text file, then everyone here can contribute to the solution you're working towards, and anyone who reads the thread (now or in future) will see how a particular problem was solved.
That's what these forums are all about: shared problems, shared solutions.
-
If you want to USE MySQL on your local computer, you really don't have any option but to install it - along with something that'll let you use your local computer as a server.
If you want to run php and MySQL and the GD library on your computer as if it were a server, then there's an 11.5 MB downloadable at www.firepages.com.au as a single package with a one-click installation. phpdev423 is perfect for all local development. I've installed it on Win NT, Win2K, and WinXP all without any problems whatsoever.
-
As far as I know, you can't create a true .xls file using php/MySQL. What you CAN do is generate a text file from the MySQL data. And then you can IMPORT that text file into Excel.
Assuming you know how to get the data you want out of your database, you'll find all you need to know about creating a text file in the manual - check fwrite for that.
-
Cautionary note: I am entering dates in the .... format. But what about every other user of the form? I'd suggest user-proofing the data entry by having three date entry fields - day, month, year (dropdowns are nice and user-proof). Then it doesn't matter what date format the user thinks of using, since your form will always have the responses in the same format.
-
It might help if we knew the MySQL version number that works, the version number that fails, and the specific error you get when the script fails.
-
Not to an xls file directly ... but you can export MySQL data to a CSV file (or any other separator) very easily, and then import the .csv file into Excel.
-
male, older than dirt ... learned to 'program' on a PDP-8i
-
You might have some success if you closed this thread (which has no connection with php hacking as meant here) and re-started it in the freelancing forum. Even more so if you provided a clue as to whether you have 4 files that need improvement or 400
-
This forum isn't about illegal 'hacking'. If you want the password that belongs to YOUR account somewhere, send an email to the site webmaster where you've forgotten your password.
-
Where should I start?
That depends on what you want to do. The limit is your imagination.
Try looking through some of the tutorials here for starters, and/or read posts here that appear to relate to something that interests you.
-
I'd say you definitely made the right decision to dump the hosting company with the clapped-out server.
-
The phpinfo script from your domain clearly shows register_globals is set to ON, so you should be able to read passed variables 'directly'. Can you post a small sample of code that works locally and doesn't work on your domain server, so we can take a closer look just in case there's something weird there?
-
Depends on how you retrieve the passed parameters. Best guess is that your server is set to register_globals OFF (the more secure setting). Retrieving a URL passed parameter then requires code like so:
<?php $id = $_GET['id']; // url passed parameter ....
-
Holy Smoke! I'd like to see your site - with ot without a community.I Know everything there is to know about Photoshop & Dreamweaver -
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php
[/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"And no more script error message.\"[/span][span style=\"color:#007700\"];
[/span][span style=\"color:#0000BB\"]?>[/span]
[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
-
Click PHP button = Status Bar message - Script Error!
At least it didn't say "user error"
-
Am I missing the whole point to this, or isn't the simple answer "just don't force any position on an element of this type, let it appear where it belongs" - in this case, after the search results.
-
<?php
include("filename.inc"); // or filename.php
?>
That's all there is to it. In the example above, filename.inc must be in the same directory as the script that includes it of course.
-
<input type="hidden" name="DateWonorLost" value='<?php echo date("m/d/Y"); ?>' />
That will populate the field whenever the form is displayed. If you only want that field to be populated when a radio button is clicked, you'll have no option but to do it with javascript OR have the form resubmit itself. Maybe that'll help
-
Dumb question: why not have the date in that field whether they click won, click lost, or do nothing? That way you can populate the field using php server-side, rather than relying on client-side javascript (which might not necessarily be active).
Actual php code will vary depending on what date format you want in the field.
-
.. is this possible? Using DreamweaverMX
It's possible with a simple text editor, so I would hope it's possible with a $$$$expensive editor.
Seeing some actual code might help someone provide a solution.
-
Can someone tell Dummy here why the script below won't work??
I doubt it, because it's just about unreadable and nobody's going to take the time to figure out where one line ends and the next begins.
It would help if you edited your post so that each line of your code was on a separate line, and you wrapped the code with the 'CODE' tags available here.
-
BTW, this is a script I use on more than one client site, and there's a user-proof editor for it that allows those site owners to list, add, delete, and edit events from a protected admin area. Then again, maybe that's not what you were looking for.
-
Here's the one I use. You can format the output as you see fit. And it only shows events that haven't passed. Database table construction should be evident from the code below (I hope).
<? include("local_includes/top.php"); echo "<h1>Events Calendar</h1>"; // show what's new as a separate page - all data $nodat = "<p>The \"<em>events</em>\" database is currently empty.</p>"; include("local_includes/db_conn.php"); $dbtable = "happening"; $today = date("Y-m-d"); mysql_connect($dbhost, $dblogin, $dbpass) or die ("Error: Unable to connect to the database."); mysql_select_db($dbname) or die ("Error: Unable to open the database."); $query = "SELECT * FROM $dbtable where ev_dat>'$today' order by ev_dat"; $result = mysql_query ($query); $recs = mysql_num_rows($result); // any information in database? if(!$recs) { echo $nodat; } else { while ($myrow = mysql_fetch_array($result)) // loop through all results { echo "<h2>"; $new_dt = strtotime($myrow['ev_dat']); echo date("l, F j, Y" , $new_dt); echo "</h2><p>"; echo "Event: ". $myrow['ev_title']. "<br />Location: ". $myrow['ev_locn']; if ($myrow['ev_desc']!="") { echo "<br />Details: ". nl2br($myrow['ev_desc']); } echo "</p><br />"; } } include("local_includes/bottom.php"); ?>
Database table:
CREATE TABLE happening (id smallint(4) NOT NULL auto_increment,
ev_dat date NOT NULL default '0000-00-00',
ev_locn varchar(60) NOT NULL default '',
ev_title text NOT NULL,
ev_desc text,
PRIMARY KEY (id)
) TYPE=MyISAM;
best way to have a 'send to all members' mail?
in MySQL Help
Posted
I'd go for a loop as well .... but every five emails or so I'd add a brief sleep() so nothing overloaded.