Jump to content

krixham

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

krixham's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've been struggling with this for over a week, and I really need some help. I don't know if it's a problem with the Apache version, or if it's something with PHP or MySQL that is causing this strange behavior. I had developed an internal web page, and hardcoded everything. It was prior to having MySQL and PHP installed. The Apache version was 2.0.40-dev Revision: 1.116. The page had 5 frames, and when I had something in each frame, and clicked on the reload button in the browser, all the data for all other frames pretty much stayed there, just refreshing information that had changed. Now I am teaching myself PHP and MySQL, and have rewritten the web page to include calling out information from a database. I still have frames, and am now using MySQL queries to build tables to show in each frame. The Apache version on this server is 2.0.40-dev Revision: 1.146. But, now when I click on the reload button, I seem to clear out all the frames. Am I missing something? I know, I'm a newbie, but at least I am trying! Kathy
  2. Oh, where do I start? I am building a web site with PHP and MySQL. And struggling, as my prior posts have revealed. I have no 'tools' to help me with it, and am writing the html, php, and queries from scratch. Is there some rule that says I cannot do this: [blockquote] 1. Run index.html, which launches a php script and lists all the clients. THIS IS WORKING 2. Depending on the client, and if they have information in 'sub jobs', do one of two things (this is part of a cgi script) - If they have nothing listed in the MySQL table for a sub job, then list all the order numbers - THIS IS WORKING If they have something listed in the MySQL table for a sub job, then launch another php script. [/blockquote] That's where I start having trouble... I have written the script with html and php. All of a sudden the server doesn't seem to like the coding for php. I've even gone so far as to try to launch the 'helloworld.php' script, with no luck. Now, helloworld works fine in the web browser itself, just not when it's launched inside the cgi script. I keep getting things like: [blockquote] ?php: No such file or directory syntax error near unexpected token `(' `$conn = mysql_connect("localhost","user","password");' [/blockquote] I have tried using Korn Shell and Perl and even just HTML. Nothing works. But other scripts set up the same way are working. And, to be honest, it's almost like when I get to this it doesn't want to do a new php session. I am tearing my hair out here. HELP! Kathy
  3. This is now solved, thanks to some information in the topic 'selecting empty columns'. [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87617\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=87617[/a] I appreciate the input I am receiving, and thank everyone for their help. Kathy
  4. Ken - THANK YOU. This is very similar to what I was trying to do with one of my scripts, but couldn't figure out where to put it. This response put me in the right area. Kathy
  5. I've been trying and trying and trying to get this to work. I keep telling my boss that I am too stupid to be doing this, but he won't listen <S>. Thank you php_b34st for the input, and I can see where it should work, but for some reason it just isn't doing what I need it to do. There are only two choices under job_id_name - either it is blank or it has something in it. Which is where I am struggling. I need to display the first field based on proj_name, grouped by proj_name, or DISTINCT proj_name. My issue is that I don't quite know the MYSQL commands to get the entire process to do what I need it to do. Back to the old drawing board... Maybe now my boss will believe it????????????? Kathy
  6. Now, this code is working, and I am getting the list that I need... [blockquote]<body> <?php // Make the connection to MySQL and select the database $conn = mysql_connect; mysql_select_db; $result=mysql_query('SELECT * FROM production_dirs') or die ("Error in query: " .mysql_error()); // Close the connection to MySQL mysql_close(); echo "<table width='100%'> <table style=\"font-family: arial; font-size: 10pt;\">"; $num=mysql_numrows($result); // Start the loop $i=0; while ($i < $num) { // Define your variables // We only want to display the field proj_name for this exercise $proj_name=mysql_result($result,$i,'proj_name'); // However we also need the job_name $job_name=mysql_result($result,$i,'job_name'); // AND the job directory $projdir=mysql_result($result,$i,'projdir'); echo "<tr> <td> [b][!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]<a href=\"http://172.27.19.36/main.menu.php?$job_name\&$proj_name\&$projdir\" target=clienttype onclick='top.clienttype.location=\"../blank.html\"'> $proj_name \n</a>[!--colorc--][/span][!--/colorc--][/b] </td> </tr>"; // End loop $i++; } // End table echo "</table>"; echo "</span>"; ?> <!-- Now end the HTML --> </body> </html>[/blockquote] The problem is happening with the bolded line. Where I am sending the variables on to the next script, and using the clienttype frame on the web page. What I need to do at this point is read another table and the results of that table determine if I go to the clienttype frame or the orderframe, depending on what is in the field 'job_id_name', Thing is right now everything goes right to clienttype. I know this is stupid, but does anyone have any suggestions? For what it's worth, the script that I am trying to kick off is this one: [blockquote]<?php $input = ($_SERVER[argv][0]); $input_array = explode("\&", $input); echo "<pre>";print_r($input_array);echo "</pre>"; $client = $ARGV[0]; $name = $ARGV[1]; $jobdir = $ARGV[2]; // Make the connection to MySQL and select the database $conn = mysql_connect; mysql_select_db; // Query your table // In this case we are chosing from the jobinfo TABLE // and are choosing ALL the entries $result=mysql_query('SELECT * FROM jobinfo') or die ("Error in query: " .mysql_error()); // Close the connection to MySQL mysql_close(); $num=mysql_numrows($result); // We need the job_name $job_name=mysql_result($result,$i,'job_name'); // We need the conf_file $conf_file=mysql_result($result,$i,'conf_file'); // We need the job_id_name $job_id_name=mysql_result($result,$i,'job_id_name'); if($job_id_name = '') { system ("cd $jobdir"); system ("/usr/local/apache2/cgi-bin/order.cgi $client $job_name $conf_file jobdir"); } else { system ("cd $jobdir"); system ("/usr/local/apache2/cgi-bin/choose.cgi $client $name"); print "$jobdir $client\n"; } ?> exit 0;[/blockquote] As you can see, I thought of trying to just kick off two seperate scripts. But, it isn't working. Oh, I can see why, I just don't know how to get around it. This was SO much easier just using HTML and static tables. And the MySQL and PHP was my idea 8-(
×
×
  • 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.