Jump to content

ramyakumar

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ramyakumar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello Everyone, I have triple drop down menu. I want to display the contents of the table based on the third menu selection. The code is in the link http://php.pastebin.com/hgazULxi I know I need to include a onchange function to <select name="genus"> but as you can see I have a <div> already for it. I am confused how to create the function to display the table and also the how to include another div tag. Could some one help please??? Thank you Ramya
  2. Hello everyone, I am trying triple drop down menu first and second menus are working but third one is not working and also the data is not being displayed on the webpage even though I have used "echo" command.. I am unsure what is the problem and how to correct it. So I am attaching my code in this email, could you please look into it and help me with it. I have 1st drop menu for State : Tennessee Alabama Georgia 2nd Drop down list for County: Anderson Bredford Benton 3rd Drop down list for Genus Acer Aristida Eg: Tennnesse -> Anderson, Bredford, Benton and Anderson -> Acer, Aristida and when I select Tennesse->Anderson->Acer it has to display all the information of the table based on these selected values. Could you please help me with this. This is my link for the complete code http://pastebin.com/vvLrpCcr The execution link is http://sozog.utc.edu/~tdv131/MYSQL/genus1c.htm
  3. Hello, I am trying insert the values of csv file into a table. I want to concatenate the values of some columns of csv into one String column of table by delimiting them my commas. $im="INSERT into TB1 (col1, col2 ) values ('$a[2]','$a[3]')"; $b = ""; $b=".'$a[6]'."||".'$a[7]'."||".'$a[8]'."||".'$a[9]'."; $im1=$im+"UPDATE TB1 set latlng=.'$aline'."; mysql_query($im1) OR die(mysql_error()); I need to enter the value of $a[6] till $a[9] into a string column with delimiters and insert into the column col3 of TB1 with value as $a[4]. I am stuck up here could anyone help me with this issue.
  4. Hello, I am trying to display a music table using mysql and php. I have a music table with categories and other data like name, price, category, singers. I want to display categories of the music that $music and the number of cds in that category is $no. I am not able to display the number of dvds in correspond with the category. It is showing me all the counts in a single line in each row. It is repeating the count in all the rows. this is the query and code $query = "SELECT DISTINCT category, COUNT(*) AS num_dvds from dvds GROUP BY category"; echo '<table>'; foreach ($music as $v) { echo '<tr>'; echo '<td><input type="checkbox"></td>'; echo '<td>' . $v . '</td>'; foreach ($num_dvds as $no) echo '<td>' . $no . '</td>'; echo '</tr>'; } echo '</table>'; I think it is problem of the arranging of foreach or the braces but I tried many ways and nothing worked for me. Could anyone help me please?
  5. I m writing a code in mysql using php. I have a database based on world. CREATE TABLE world ( place VARCHAR(50) NOT NULL, region VARCHAR(15) NOT NULL, distance VARCHAR(20), ) I have a code which have particular regions but then I want it to also display number of places based on region. I have written a query which is working but I want it to display region and number of places in that region. How do I do this with my code? foreach ($regions as $r) { echo '<option value="',$r,'">',$r,"</option>"; echo '</select></p>'; } Please help me.
  6. Yes I have already given "a" in the fopen. I am very sure the directory is created and even the permissions to access it are set but still it is giving me warning but still it wont allow it to create too. Warning: fopen(PHP): failed to open stream: Is a directory in /home/ram/public_htmlPHP/formfile.php on line 24 Warning: fclose(): supplied argument is not a valid stream resource in /home/ram/public-html/PHP/formfile.php on line 34 When I used only fopen function with the flags set to it, it did not allow me to store the contents in the file too. I had to use getFileName($path) and then it worked but now it is not allowing me to store into the directory too whatever I do.
  7. I am using putty server with Windows XP as my os I am already using flag, a to create and append to the file. <?php $handle=fopen("/PHP/" . $file, "a"); ?>
  8. I had the same problem but later I used getFilename instead of using filename directly in the fopen. This link should help you. http://roshanbh.com.np/2008/01/getting-filename-and-extension-in-php-using-explode-and-pathinfo.html
  9. Thanks. It worked by using the code $file=$name; But I want the filename in a particular directory like PHP/Peter.txt. This is not happening even though I set the permissions of the file and the directory. It displays an error "fopen cannot open directory: Is a directory /PHP/Peter.txt ". Could anyone please help me with this.
  10. Thanks for the reply but it did not work for me. I am creating the file name to store the form values using the name provided by the user. Suppose if there is a user with name "Peter" then I want the file name created in his name like "Peter.txt". I hope this should help you people to help me with the code. Thanks
  11. I tried this method with fwrite or file_put_contents but that too did not give the required result.
  12. I tried chmod() but I could not succeed in setting the permissions or writing to the file.
  13. I am creating a form and storing the values in file. Could anyone please tell me how to write a code in php for creating a filename based on the user name as in the form. Thanks
  14. Hello, I am writing two php scripts one for form and other one to write the values of a form using php into a file and also print the values on the another html page. I dont know why it is not writing into the file but if I print the form values in the script, that is getting printed on the html page. The fopen should create the file but until I set the permissions manually it shows the error, " permission denied" on the html page. I even checked the path of the file. When I Execute the file, it directly goes to the else clause, "Cannot write to the file". Could anyone please help me with this quickly. I am using this code for writing to the file: $filename="test.txt"; if(is_writable($filename)){ if(!$fp = fopen($filename,'a')){ echo "cannot open file($filename)"; exit; } if($fp!=null) { fwrite($fp,$name); fwrite($fp,$date); fwrite($fp,$platform); fwrite($fp,$browser); fwrite($fp,$comments); } fclose($fp); } else { echo "Cannot write to the file"; } Thanks
×
×
  • 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.