Jump to content

1989gta

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

1989gta's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. with the help of a friend i was able to get this working. here is the code if ($form_type == 'uninstalled'){ $current_date = date('m-d-y'); $query = "select name,app from deletes where takeover = 'yes' and uninstalled <> 'yes'"; $result = mssql_query($query); while ($row = @mssql_fetch_row($result)) { $query1 = "select machine_name,package_name from conversions where date_current = '$current_date' and machine_name ='$row[0]' and package_name ='$row[1]'"; $result1 = mssql_query($query1); if(mssql_num_rows($result1)>0){ //this is the line that solved the issue while ($row1 = @mssql_fetch_row($result1)) { echo "$row1[0]"; echo "-\n"; echo "$row1[1]"; echo "-\n"; echo "<b>still installed</b><br />"; } }else{ echo "$row[0]"; echo "-\n"; echo "$row[1]"; echo "-\n"; echo "<font color='red'>uninstalled</font> <br />"; }} }
  2. i have updated and simplified the page, in the if statement i can get it to work and display apps still installed but when i add an else or look for =='' it still displays nothing any ideas? thanks for looking ///////////////////uninstalls ///////////////// if ($form_type == 'uninstalled'){ $current_date = date('m-d-y'); /////////////////1st querys machines marked for delete but not uninstalled///////////////// $query = "select name,app from tbldeletes where takeover = 'yes' and uninstalled <> 'yes'"; $result = mssql_query($query); while ($row = @mssql_fetch_row($result)) { ////////2nd query takes data and looks in marimba for uninstalled or not and outputs machines not uninstalled// $query1 = "select machine_name,package_name from marimbaconversions where date_current = '$current_date' and machine_name ='$row[0]' and package_name ='$row[1]'"; $result1 = mssql_query($query1); while ($row1 = @mssql_fetch_row($result1)) { if ($row1 != ''){ echo "$row1[0]"; echo "-\n"; echo "$row1[1]"; echo "-\n"; echo "<b>still installed</b><br />"; }}}}
  3. I've been doing manual reporting for some time now and would like to automate my table but i've hit a road block, i have two tables one that i manually alter(deletes) and a data pump (conversions) that i reference. Basically i run a look up find all the machines that should not have an app installed check the conversions table to make sure it's gone then update the deletes table with my findings but something is missing can you point me in the right direction? <? ////////////////////uninstalls ///////////////// if ($form_type == 'uninstalled'){ $current_date = date('m-d-y'); /////////////////1st query pulls all the workstations have installed but not uninstalled///////////////// $query = "select name,app from deletes where takeover = 'yes' and uninstalled <> 'yes'"; $result = mssql_query($query); while ($row = @mssql_fetch_row($result)) { ////////2nd query takes data and looks for uninstalled or not and outputs machines not uninstalled// $query1 = "select machine_name,package_name from conversions where date_current = '$current_date' and machine_name ='$row[0]' and package_name ='$row[1]'"; $result1 = mssql_query($query1); while ($row1 = @mssql_fetch_row($result1)) { ///////takes output and querys all machines that have the app but not that workstation////////////////// /////////////////////no workey/////////////////////////////////////////////////////////// $query2 = "select name,app from deletes where takeover='yes' and uninstalled <> 'yes' and name <> '$row1[0]' and app ='$row1[1]'"; $result2 = mysql_query($query2); while ($row2 = @mysql_fetch_row($result2)) { echo $row2[0]; echo "-\n"; echo $row2[1]."<br>"; /////////take output and update and update the unistalls///////////////////////////// $query3 = "update deletes set uninstalled ='yes' where name ='$row2[0]' and app ='$row2[1]'"; $result3 = mssql_query($query3); while ($row3 = @mssql_fetch_row($result2)) { echo $row3[0]; echo $row3[1]."<br>"; } } } } } ?>
  4. I’m running into a problem when writing my page what I want is to run a query that will pull a list of application names, echo the first application name in the query. The next query will run using that application name pull a count and then echo the count to the page then loop and start all over again with the next app and count. For some reason I can’t get it to work. <? echo "<table border=1>"; echo "<tr>"; echo "<td>Application</td>"; echo "<td bgcolor=#f8f3df>Todays Totals</td>"; echo "</tr>"; ///////////////////////////////////application///////////////////////////////// $query = "SELECT app_name,install_date FROM tbl where app_name <> ''"; $result = mssql_query ($query); while($line = mssql_fetch_array($result)){ echo "<tr border=1>"; $app =$line[0]; /////////////////////////////////////todays totals///////////////////////////// ////////////////////////////////////pull current date////////////////////////// $current_date = date('m-d-y'); $query = "select count(*) from conversions where date_current ='$current_date' and package_name='$app'"; $result = mssql_query ($query); while($line = mssql_fetch_array($result)){ $todays_count = $line[0]; $test = explode(",","$app"); for ($i=0; $i < Count($test); $i++) { echo "<td nowrap>"; echo"$test[$i]"; echo "</td>"; } } } echo "</tr>"; echo "</table>"; ?> With this I’m just trying to echo all the application names but as soon as I add the explode and loop it only echos the first app so i'm lost.
  5. ah i see it pumps all my data into a stored array then once all the querys have exhausted them selfves it will echo everything. Yes that is exactly what i was looking for thank you
  6. I am in the process of writing a page and I need a point in the right direction Basically the page will resemble a spread sheet with 8 columns. I have all the queries worked out my code will look something like this (below) the information in column A will be used in every query through out the page. echo "<table border=1>";     echo "<tr>"; echo "<td>column_A</td>";       echo "<td bgcolor=#f8f3df> column_B</td>";       echo "<td bgcolor=#f8f3df> column_C</td>";       echo "<td bgcolor=#f8f3df> column_D</td>";       echo "<td bgcolor=#f8f3df> column_E</td>";       echo "<td bgcolor=#f8f3df >column_F</td>";       echo "<td bgcolor=#f8f3df> column_G</td>";       echo "<td> column_H</td>";     echo "</tr>"; /////column_A////// $query = ""; $result = mssql_query ($query); while($line = mssql_fetch_array($result)){ echo "<tr border=1>"; $app =$line[0];   $install_date =$line[1];   echo "<td>";   echo $A); echo "</td>"; } ////b//// $current_date = date('m-d-y'); $query = "";       $result = mssql_query ($query);                         while($line = mssql_fetch_array($result)){     $todays_count = $line[0];       echo "<td>";         echo $B;       echo "</td>"; } and so on with the remaining 6 queries... The problem I'm having is this seems to work fine when i have one piece of data echoed for column A all the query's run and echo what needs to, but when i have more that one piece of data it only echo's the last piece of data queried so i need to change the page so when the query for column A and it finds more than one entry it takes that piece and runs the 7 query's and echoes the data and moves on the next and does the same thing. I hope that i got my point acrossed Thank you for viewing this post
×
×
  • 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.