Jump to content

Jagand

Members
  • Posts

    39
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Jagand's Achievements

Member

Member (2/5)

0

Reputation

  1. I am getting same issue even with one level of crypt..
  2. Hi, I see that when I am applying crypt function on the text 'samurai.ciscorouter1', output is same as it is for 'samurai.ciscorouter2'. Is the code I am giving how it must be? print "<hr/>" .crypt(crypt(crypt('samurai.ciscorouter1',CRYPT_SHA512), CRYPT_SHA512), CRYPT_SHA512); print "<hr/>" .crypt(crypt(crypt('samurai.ciscorouter2',CRYPT_SHA512), CRYPT_SHA512), CRYPT_SHA512);
  3. Thank you. That worked. So, the script that worked is below, for other's reference. INSERT INTO table ( primary_id ,sequence_number ,text ,text2 ,text3 ) select 30 ,(SELECT ifnull ((MAX(sequence_number) + 1), 1) FROM table WHERE primary_id = 30) ,'text' ,'text2' ,'text3
  4. I am trying to write a MySQL INSERT statement which has a SELECT query. Select query can result in NULL. If result is NULL, I want to 1 to be the value for the field. If result is not NULL, I want retrieved value. Below is the MySQL I have coded but it seems wrong. What would be the right statement INSERT INTO table ( primary_id ,sequence_number ,text ,text2 ,text3 )select 30 ,((SELECT MAX(sequence_number) + 1 FROM table WHERE primary_id = 30) AS seq_num IF (seq_num = NULL,1,seq_num)) ,'text' ,'text2' ,'text3
  5. I have a code that uses simpleXML library to generate an XML from input. I then want to insert the data into MySQL using PDO->exec(); But Insert of query doesn't happen. Can you please let me know how do I escape the query so that insert is successful. PDO::query(), PDO::prepare() haven't helped me much so looking for PHP solution to this problem. Below is the INSERT code generated INSERTINTO dbname.table(input_xml)VALUES ('<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><ip_Input><ip_xml>17:01:27Qaiku.com – What Can We Learn From Failure?By Guest Blogger, September 11, 2012, Leave a CommentEditor's note: I think we in the tech press have the tendency to focus on the positive stories and forget about the startups that didn't live up their expectations. Our Sofanatics coverage this past week has been one of the few times we've covered abandoned projects, which is a pitty because there are a lot to learn from "failures." Below we have a long read from Eero Holmila which is one part eulogy, and another part what he's learned from the now-announced shutdown of Qaiku.com.Qaiku.com might be a familiar name for some of the readers of Arctic Startup. However, I am quite sure that the background and the rough road from high hopes to a bitter decline probably is not. I am the CEO of Rohea, a company behind a handful of quite successful Finnish websites like Kotikokki.net, Kuvake.net, Mikseri.net and of course a less successful Qaiku.com.I am going to share some lessons learned through the trip. I hope some of it might be of use, spark up ideas or if nothing else, be at least a bit entertaining. One last important disclaimer: all the opinions are my own.Now without further delay, this is the story of Qaiku.</ip_xml></ip_Input>');
  6. Thank you both. I want to place a lot less stress on PHP but with what you said, it looks like I will not be stressing the server a lot using case #1 if I happen to display just 10 - 20 results at a time. I am a newbie to programming and I will learn the concepts of JSON before I choose between option 1 and 2.
  7. I have some data in MySQL table. When user searches for certain keywords, I must search MySQL table for those keywords and provide results to users. When I am providing those results, I want to display few additional columns so that user can get an idea of how data looks like. My requirement is something common in today's webpages - for example in GMail where data is fetched from database and is parsed into multiple columns such as author, subject, date written etc. What is the most efficient way to code such requests. Below were what I could think but felt that they are not very efficient Fetch each row from MySQL table and construct a HTML/CSS based table with the results. This solution is lacky in sense that there will be multiple requests and responses going between MySQL and webpage Get each row from database and construct an XML. Pass all this to Javascript and write a javascript code to parse the XML before displaying it as HTML/CSS based table. This again seems lacky in sense that code is once creating XML (through MySQL + PHP) and then parsing it in Javascript Given these, I would like to know how would a good programmer address the problem of displaying data from MySQL into front end with minimal requests and yet without lot of constructing and parsing information. Thank you in advance for any suggestions you can offer
  8. My intent is to create pages ready for printing and display to user a preview of the page to be printed. Please let me know if this clarifies.
  9. To the extent I understood your point, if you intend that the code should perform certain action using PHP alone, you must use a form with input type='button' option. You can google/bing 'HTML FORM' for more details. Sample syntax for a form is <form action='a_page_that_performs_either_approve_action.php' method='POST'> <?php print $firstname $lastname<br>$address<br>$city $state<br>$phone<br>$email<br>$typeofneed<br> ?> <input type='submit' name='approve'>Approve</button> <input type='button' name='deny'>Deny</button> <br>---------------------------<br> </form>
  10. Thank you. That is where things are looking complicated to me. Do you think its possible through PHP to determine the height of multitext data printed so far or use CSS to make a page look like its a new page when after certain height of text is printed?
  11. Is there a way I can know number of characters per line and number of lines that can fit into a page. My specific need is for page format 'Times New Roman' with A4 page format but I would like to know if there is a function in general that can help me with these details. My requirement is like this - write data into a document and when the number of characters written is large enough to fit a page, I must give a page break and write rest of characters to a new page and so on. I can write a custom function for this but the term "formatted printing" associated with function printf, sprintf tempted me to think that PHP might already have a function that does this task and that a new custom function would be unnecessary. One of the complexities with creating a custom function is that non Monospaced fonts such as 'Times New Roman' take different lengths for different characters
  12. Hi, I have a word document in a non-root folder and I wrote a code that allows users to download the file. Code is rename ("../cgifolder/docxfile.docx","docx/docxfile.docx"); header("Content-disposition: attachment; filename=docxfile.docx"); header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); readfile("docx/docxfile.docx"); I have two questions ... 1. I am seeing that downloaded content a corrupt file while file on server is MS2010 readable. What is wrong with my code? 2. Can I place files in cgi without renaming it to move to root folder and still allow users to download the file Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.