dennismonsewicz
Members-
Posts
1,136 -
Joined
-
Last visited
Everything posted by dennismonsewicz
-
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Anyone have any ideas? -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Like it opens Excel but cannot open the actual XLS file. This saddens me -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
ok so I have this slight problem: It worked, but when I try to open the file it physically does not open the file HAHA this is pretty funny. Any ideas on this? -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
the file problem has been fixed, but it keeps looping the same sentence and it is only writing one record into the Excel sheet! -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
ok I am not getting an error but I am getting this problem: It is looping the line of "data is write into hr.xls successfully" There is only one record recorded into the XLS file And the file is not over-writing the previous one. Here is my code: include "../includes/db_login.php"; include("../excel/excelwriter.inc.php"); $excel=new ExcelWriter(); $myArr=array("Id","Product","Company","Description","Web Address","Last Used","Where product was last use","Is product active or inactive?"); $excel->writeLine($myArr); $query = "SELECT * FROM $tablename"; $result = mysql_query( $query ); if(!$result) { die("Could not query the database: <br/>" . mysql_error()); } while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $id = $row['rowid']; $company = $row['company']; $product = $row['product']; $description = $row['description']; $web = $row['web']; $last = $row['last']; $used = $row['used']; $active = $row['active']; $myArr=array($id,$product,$company,$description,$web,$last,$used,$active); $excel->writeLine($myArr); $excel->close(); echo "data is write into hr.xls Successfully."; } $excel->send('hr'); -
try replacing "question" with 'question'
-
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Rhodesa, is there a way to make the array's dynamic? I see where you can manually add them but how would I make them dynamic? Making them dynamic would probably be a lot easier to manage. -Dennis -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Yeah I actually need for this to be dynamic. I am trying to locate the documentation now, and can't seem to find out how to do that? -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Rhodesa, So in the below code I change the values of the $myArr variable array with the values of my header names from my DB table? <?php include("excelwriter.inc.php"); $excel=new ExcelWriter("myXls.xls"); if($excel==false) echo $excel->error; $myArr=array("Name","Last Name","Address","Age"); $excel->writeLine($myArr); $myArr=array("Sriram","Pandit","23 mayur vihar",24); $excel->writeLine($myArr); $excel->writeRow(); $excel->writeCol("Manoj"); $excel->writeCol("Tiwari"); $excel->writeCol("80 Preet Vihar"); $excel->writeCol(24); $excel->writeRow(); $excel->writeCol("Harish"); $excel->writeCol("Chauhan"); $excel->writeCol("115 Shyam Park Main"); $excel->writeCol(22); $myArr=array("Tapan","Chauhan","1st Floor Vasundhra",25); $excel->writeLine($myArr); $excel->close(); echo "data is write into myXls.xls Successfully."; ?> -
Try this website: http://www.w3schools.com/php/php_mysql_insert.asp
-
Does anyone know how I can do a PHP export from a website into an excel spreadsheet? Example: My company intranet has a ton of data that is loaded into MySQL and one of the users of the intranet wants an export to excel function. So if they are looking at a table of data they can click on export to excel and it does it. Anyone know where to start? -Dennis
-
[SOLVED] Exploding Dynamic index.php
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
FIGURE IT OUT! THANKS AGAIN! -
[SOLVED] Exploding Dynamic index.php
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Thanks for everyones help. I love this forum! One more question: How would I uppercase just the first letter of a word using php? Wouldn't it be like ucase($string)? -
[SOLVED] Exploding Dynamic index.php
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Awesome! But now how would I capture the page a user is on? -
Ok... I want to be able to use the breadcrumb function in PHP but with a twist. Is there anyway to capture the page someone is one and display the breadcrumb backlinks capturing the page and stripping the .php from the page? Example: You are here: HOME > Users.php But I want to take the .php away from the Users.php to give the user this: You are here: HOME > Users
-
Session Variables and Databases
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Thanks! And this is safe right? -
This is probably a stupid question, but I was wondering if it is ok to use session variables in a SQL Query? Example: sql = "Select * From users Where username = " . $_SESSION['username'] . ";
-
is there anyway you can include an example?
-
I have a login script in place now for a company intranet, but I need to have a session timeout so after say like 30 minutes of no activity the user is logged out. Can anyone help with this? This is my login.php page: <p>To login, please fill out the form below with your given username and password</p> <div id="loginform"> <form name="form1" method="post" action="checklogin.php"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td>Username: </td> <td><input name="username" type="text" id="username" /></td> </tr> <tr> <td>Password: </td> <td><input name="password" type="password" id="password" /></td> </tr> <tr> <td colspan="2"><input type="image" src="../images/login.gif" class="submit" alt="Submit Changes" value="Login" /></td> </tr> </table> </form> </div> Do I need to pass a hidden input somehow recording the time of login? This is my checklogin.php page: ob_start(); include "includes/db_login.php"; // username and password sent from signup form $username = $_POST['username']; $password = $_POST['password'] $sql="SELECT * FROM users WHERE username='$username' and password='$password'"; $result=mysql_query($sql) or die(mysql_error()); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $username and $password, table row must be 1 row if($count==1){ // Register $username, $password and redirect to file "login_success.php" session_register("username"); session_register("password"); header("location: http://intranet.healthresources.net/index.php"); } else { include "includes/header.php"; echo "<p>Wrong Username or Password</p>"; echo "<p><a href='index.php'>Try Again?</a></p>"; include "includes/footer.php"; } ob_end_flush(); All help is greatly appreciated, Dennis
-
Sorry bout my previous post... I reckon i didn't understand ya. Ok... I know how to do what you are talking about. Let me look at some code I have written and get back with you
-
Try the site below. http://www.w3schools.com/sql/func_count.asp
-
yeah...you are going to have to pass the table names in the URL. Or at least thats how i did it. so your URL would like something like this: http://www.yoursitename.com/form.php?table=tablename your code: $var = $_GET['table']; $query = "SELECT * FROM " . $var . " ; Or something to that effect. This could extremely "hairy" LOL!
-
For your query statements you are going to need to look into the UNION SQL Command
-
[SOLVED] Edit/Update Record via Form
dennismonsewicz replied to aeafisme23's topic in PHP Coding Help
also take out the echo part of your values -
[SOLVED] Edit/Update Record via Form
dennismonsewicz replied to aeafisme23's topic in PHP Coding Help
try placing all of your closing brackets in the last open and closing PHP tags