
Wayniac
Members-
Posts
89 -
Joined
-
Last visited
Never
Everything posted by Wayniac
-
Well... this is a little embarrassing... Thank you for correcting my ignorance to triple check.
-
This issue I am having is it seems every time this calculation is made on whatever the value may be, its always off by either a positive several cents or a negative several cents. I tracked the reason down to it not rounding to the nearest 10. Thus resulting in a bunch of random decimals being calculated together instead of rounded and then calculated... In this case, the end value should be 31.04, but instead its 31.43. FYI: Variable v1 = 1 in this circumstance... document.getElementById("txt_price2").value = v1 * 24.95 * 1.0795 + 9.50 - 5.00; Really appreciate some way in getting this to round off properly...
-
Well, after a while of playing with it, I got it working. I'll post the working copy below. DROP TABLE IF EXISTS `spreadsheet`; CREATE TABLE `spreadsheet` ( `spreadsheetid` int(11) NOT NULL auto_increment, `date` date NOT NULL, `invoice_num` int(35) NOT NULL default '0', `conf_num` int(35) NOT NULL default '0', `fname` text, `lname` text, `bill_add` varchar(255) default NULL, `bill_city` varchar(255) default NULL, `bill_zip` varchar(255) default NULL, `bill_state` text, `bill_country` text, `ship_add` varchar(255) default NULL, `ship_city` varchar(255) default NULL, `ship_zip` varchar(255) default NULL, `ship_state` text, `ship_country` text, `terms` varchar(255) default NULL, `item_num` int(35) NOT NULL default '0', `desc` varchar(255) default NULL, `quantity` int(11) NOT NULL default '0', `price` varchar(255) default NULL, `amount` varchar(255) default NULL, `sh` varchar(255) default NULL, `total` varchar(255) default NULL, `ccard` varchar(255) default NULL, `color` int(3) NOT NULL default '0', `label` varchar(255) default NULL, `email` varchar(255) default NULL, `phone` varchar(255) default NULL, `order_date` date NOT NULL, `inv_total` int(11) NOT NULL default '0', `inv_minus_sales` int(11) NOT NULL default '0', `trees_sold` int(11) NOT NULL default '0', `trees_gifted` int(11) NOT NULL default '0', `trees_comp` int(11) NOT NULL default '0', `unit_cost` varchar(255) default NULL, `sub_total` varchar(255) default NULL, `tax` varchar(255) default NULL, `total_paid` varchar(255) default NULL, `payment_method` text, `notes` varchar(255) default NULL, `date_sent` date NOT NULL, `attn` varchar(255) default NULL, `seedlings` int(11) NOT NULL default '0', `four_four` varchar(255) default NULL, `hear_about` varchar(255) default NULL, `order_emp` varchar(255) default NULL, `comm_fname` text, `comm_lname` text, `comm_total` varchar(255) default NULL, `comm_date_paid` date NOT NULL, PRIMARY KEY (`spreadsheetid`) ) ENGINE=MyISAM AUTO_INCREMENT=62 DEFAULT CHARSET=latin1;
-
Okay, so I removed the defaults because they were not being used for anything, but am still having an issue with the NOT NULL.... My server is: MySQL 5.0.77-log running on MySQL Server Farm 2
-
Any idea on what part of my syntax could be causing this issue? CREATE TABLE `spreadsheet` ( `spreadsheetid` int( 11 ) NOT NULL auto_increment, `date` varchar default NOT NULL , `invoice_num` int( 35 ) NOT NULL , `conf_num` int( 35 ) NOT NULL , `fname` text, `lname` text, `bill_add` varchar default NULL , `bill_city` varchar default NULL , `bill_zip` varchar default NULL , `bill_state` text, `bill_country` text, `ship_add` varchar default NULL , `ship_city` varchar default NULL , `ship_zip` varchar default NULL , `ship_state` text, `ship_country` text, `terms` varchar default NULL , `item_num` int( 35 ) NOT NULL , `desc` varchar default NULL , `quantity` int( 11 ) NOT NULL , `price` varchar default NULL , `amount` varchar default NULL , `sh` varchar default NULL , `total` varchar default NULL , `ccard` varchar default NULL , `color` int( 3 ) NOT NULL , `label` varchar default NULL , `email` varchar default NULL , `phone` varchar default NULL , `order_date` varchar default NULL , `inv_total` int( 11 ) NOT NULL , `inv_minus_sales` int( 11 ) NOT NULL , `trees_sold` int( 11 ) NOT NULL , `trees_gifted` int( 11 ) NOT NULL , `trees_comp` int( 11 ) NOT NULL , `unit_cost` varchar default NULL , `sub_total` varchar default NULL , `tax` varchar default NULL , `total_paid` varchar default NULL , `payment_method` text, `notes` varchar default NULL , `date_sent` varchar default NULL , `attn` varchar default NULL , `seedlings` int( 11 ) NOT NULL , `four_four` varchar default NULL , `hear_about` varchar default NULL , `order_emp` varchar default NULL , `comm_fname` text, `comm_lname` text, `comm_total` varchar default NULL , `comm_date_paid` varchar default NULL , PRIMARY KEY ( `spreadsheetid` ) )ENGINE = MYISAM AUTO_INCREMENT = 62DEFAULTCHARSET = latin1 MySQL said: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default not NULL, `invoice_num` int(35) NOT NULL, `conf_num` int(35) NOT N' at line 3
-
Thank you so much, that worked way too easy. I was created IF statements and mocking up ways to make this work... Once again, thank you much. I checked out your website, I love the name and meaning behind it, too cool.
-
Greetings everyone, I currently have my database date field "priority2" set to ORDER ASC. I also have another database field called "priority". The purpose of priority is to organize the entries into groups of importance (Ex: Current(100), Pending(200), Completed(300)). Both of these work very well. The problem is that I need to integrate them so that it all of the entries under "Current Priority" will be arranged in ASC format and so fourth. Here is my code for Priority: $query = "SELECT * FROM intheloop ORDER BY priority ASC $limit"; Here is my code for Priority 2: $query = "SELECT * FROM intheloop ORDER BY priority2 ASC $limit"; Basically I can switch the name and it will change to either one, how can I make it so that there both being used together... I await your reply, thank you so much for anything that you can offer to help push me in the right direction.
-
Sweet thank you, I also got some help from Stephen and he suggested to use this which works brilliantly. $testimonial = mysql_real_escape_string(stripslashes($_POST['testimonial'])); Thank you everyone, you helped me HUGE!
-
So I am okay to use the $testimonial = stripslashes($_POST['testimonial']); in replace of the "mysql_real_escape_string" since its working fine, its not going to cause me any harm down the road.
-
Thank you so much, its working now! I changed: $testimonial = mysql_real_escape_string($_POST['testimonial']); To: $testimonial = stripslashes($_POST['testimonial']); Should I be concerned that I am not using "mysql_real_escape_string"? All I know about this is that its currently the newest way to pass it in the versions today.
-
Thank you both for your quick and informative replies. I have here what is going to be outputted, along with an example code. Not sure how to implement it, am I in the right direction? My code: $testimonial = mysql_real_escape_string($_POST['testimonial']); Example code: echo stripslashes($_POST['testimonial']);
-
Hello everyone, This is an interesting issue and after a few OMGs and HOLY beeps I figured out why my code stopped working. First I wanted to get rid of my nasty "\" backslash from popping up every time I made an entry with a apostrophe, it would create a backslash before it. So I went into my "php.ini" and typed in "magic_quotes_gpc=off". Yay solution solved, and now backslashes were no more. Now the lovely code I am going to post before you is what stopped working. Its suppose to do a search using the words I typed in and filter out only what matches, pretty standard. Except, what use to work beautifully, has now just stopped and nothing happens when I hit the submit. Here is the code below: <? //This is only displayed if they have submitted the form if ($searching2 =="yes") { echo "<h2>Results</h2><p>"; //If they did not enter a search term we give them an error if ($find2 == "") { echo "<p>You forgot to enter a search term"; exit; } // We preform a bit of filtering $find2 = strtoupper($find2); $find2 = strip_tags($find2); $find2 = trim ($find2); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM album WHERE upper($field) LIKE'%$find2%'"); //And we display the results while($myrow = mysql_fetch_array( $data )) { echo "<img src=\"get_image.php?image={$myrow['albumid']}\" width=\"50\" height=\"50\" border=\"1\" align=\"right\">"; echo ("<span class=\"TextoBaseLarge\">" . $myrow['title'] . "</span>"); echo "<b><br>Posted: </b><i>"; echo $myrow['dtime']; echo "</i><b><br>Year: </b>"; echo $myrow['year']; echo "</i> year(s)"; echo "</i><b><br>Month: </b>"; echo $myrow['month']; echo "</i> month(s)"; echo "</i><b><br>State / Province: </b>"; echo $myrow['state']; // Now print the options to (Read,Edit & Delete the entry) echo "<br><a href=\"read_more.php?albumid=$myrow[albumid]\">Read Entry </a><br><br>"; echo "<hr align=left width=280 color=\"#4e592f\">"; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } //And we remind them what they searched for echo "<b>Searched For:</b> " .$find2; } ?> Hopefully someone has encountered this problem and I can simply bonk myself on the head for an easy fix. Thank you
-
Thank you both.
-
Hi all, I am looking to see if its possible to add a user post interface such as this area I am typing in now to give the user more freedom by allowing them to change the size of the font, style, etc. I have an album right now where I type into the field and hit submit and it adds it to a separate page. Any ideas on whats this sort of thing is called or any tips to get started? PS: Could an admin change the Subject title for me, since I don't know what this is called, it may confuse future readers with this same issue.
-
Hey all, I am trying to figure out what the best way for me to try and set up a max file size (ex: 150kb) for my image upload script. Here is an example of one of my previous attempts: list($size, $width, $height, $type, $html_string, $mime) = getimagesize($_FILES['imagefile']['tmp_name']); if ($size > 150000) { echo "Error: Image SIZE must be 150kb or less.<br>"; echo "<a href=\"javascript:history.back()\">Return to previous page.</a>"; exit(); } The code above is using a notation type of 1000. I also tried 1024 notation which was 153600 bytes (150kb). Neither of these worked properly. When I tried to upload a file that was 64kb, my error check popped up saying it was over 150kb. Is there something wrong with my code or the method I am approaching.
-
Thank you, works now
-
Sorry, forgot to mention. This is what I would like to know. How would I get the actual image value so I can tell the user that they have to re-size it first before uploading.
-
Hey all! I'm having a hard time understanding how one retrieves an images width that is about to be uploaded? I am just trying to give it a simple error check to say "keep under 500 pixels". Below is an if statement I threw together. Nothing is spit out and it uploads normally, even if I upload an image larger then 500 pixels width. It must be something with it not being declared properly. if ($imageWidth > 500) { echo "Error: Image width must be 500 pixels or less."; exit(); }
-
Thank you so much Stephen, this works better then amazing! Here is the working updated code with a few changes. Sorting Order</span><br> <select name="sort" class="textBox_center" id="sort" style="width:150px;"> <option value="1" onclick="newestentries.style.display='block';youngesttrees.style.display='none'">Newest Entries</option> <option value="2" onclick="newestentries.style.display='none';youngesttrees.style.display='block'">Youngest Trees</option> </select> <div id="newestentries" style="display: block"> <?php $result = mysql_query("SELECT * FROM album ORDER BY dtime DESC",$connect); while ($row = mysql_fetch_assoc($result)) { echo(" <a href=\"read_more.php?albumid=" . $row["albumid"] . "\">" . $row["title"] . "</a><br />"); } ?> </div> <div id="youngesttrees" style="display: none"> <?php $result = mysql_query("SELECT * FROM album ORDER BY age DESC",$connect); while ($row = mysql_fetch_assoc($result)) { echo(" <a href=\"read_more.php?albumid=" . $row["albumid"] . "\">" . $row["title"] . "</a><br />"); } ?> </div>
-
Any suggestions on how I might be able to switch from newest entries to youngest trees? I can't get it to change between them when the drop down menu's item is switched. Sorting Order</span><br> <select name="sort" class="textBox_center" id="sort" style="width:150px;"> <option value="1">Newest Entries<?php $result = mysql_query("SELECT * FROM album ORDER BY dtime DESC",$connect); ?></option> <option value="2">Youngest Trees<?php $result = mysql_query("SELECT * FROM album ORDER BY age DESC",$connect); ?></option> </select>
-
Will do, and once again, thank you
-
How do you say I love you in EVERY different language??? That worked!!! You can only imagine how I feel now... I scared my dog Ollie by screaming the loudest YES ever. Thank you all, is there any information I can post to help future viewers?
-
Okay so I tried that and the second set has no data for the image. The other entries still work fine, but 0 bytes comes up in the database under the imgdata field. This only happened when I added the base64_decode / encode. Before this, it was uploading data, but giving me that binary mumbo jumbo...
-
Here is an image of the database structure being used. http://www.lifelikemedia.ca/upload/db_info.jpg
-
That did something... It made it so that all the gibberish binary content disappeared but the small image icon 24x24 pixels is there by itself now. When I right click on it and view the pictures properties it says unknown size. Really appreciate the help.. REALLY DO!