Jump to content

cobalt-rose

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cobalt-rose's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yer i googled it and could only find books that taught you how to program :s
  2. Thanks of the reply, but is there not any literature about it at all? or is it just a common fact. Thanks again
  3. Hello all, i was wondering whether you could help me with my ERD for my project. Would this be viable? here it is below Thanks in advance
  4. Hello there i am looking for a diagram/schema that basically illustrates how php/mysql/xhtml interact in a web page? As i wish to understand how it is all put together. Can anyone help? Many thanks C¬Rose
  5. Just wanted to know if there were any tutorials (or sample code) as to doing this? or how difficult it is. As i have only found packages in which you have to pay £30 odd for it ? I have a web app which out puts mysql table data and i need to export it to either a word (mail merge) and pdf doc Thanks C¬Rose
  6. o ok ill ask in the php section. do you know were i could find one though? thanks
  7. Ha ha, well basically i have a web app that shows client data in a table that is pulled from mysql. And i want to have a button that when pressed extracts invoice details for that client and put it in word to print out.
  8. Just wanted to know if there were any tutorials (or sample code) as to doing this? or how difficult it is. As i have only found packages in which you have to pay £30 odd for it ? Thanks C¬Rose
  9. Yes i do have a row that auto increments...so i do have a unique field
  10. How can i get unique values into the data table? do i have to use an array?
  11. That's the thing... it isn't passing and i am only getting the first row... I thought that as i put in the view jobs page <td class="table_results" id="' . $row['job_id'] . '" onclick=' . $LOADcreateJOB1 . '>' . $row['job_id'] . '</td> Which i thought would set the id of the table row to the id of the [job_id] that was pulled from the database then, i would be able to call the [job_id] on the profile page and select all the data where job_id(row from db) is equal to the [job_id] and display in the job profile page. This obviously isn't working so how would you suggest i go about it?
  12. Hey sorry i posted redundant code i have already added the 'second period' and it still did not work. I'm trying to get the job_id from the previous page which is a table: of jobs: BELOW: table with jobs from db <? if ($log_in = true){ $db_name = ""; $table_name = "job"; $connection = @mysql_connect("localhost", "", "") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT * FROM $table_name"; $result = @mysql_query($sql) or die(mysql_error()); $numberofrows=mysql_num_rows($result); $LOADcreateJOB1 = "$('#page_contents').load('profile_job.php');" ; echo' <div id="rounded-corner"> <p class="title">View Jobs</p> <table class="jobs"> <tr> <th ><a class="table_header" >Job ID</a></th> <th ><a class="table_header" >Job Name</a></th> <th ><a class="table_header" >Company Name</a></th> <th ><a class="table_header" >Comapny ID</a></th> <th ><a class="table_header" >Job Status</a></th> <th ><a class="table_header" >% Complete</a></th> <th ><a class="table_header" >Contractor</a></th> </tr>'; while ($row = mysql_fetch_array($result)) { echo' <tr> <td class="table_results" id="' . $row['job_id'] . '" onclick=' . $LOADcreateJOB1 . '>' . $row['job_id'] . '</td> <td class="table_results" href="index.php">' . $row['job_name'] . '</td> <td class="table_results">' . $row['FK_company_id'] . '</td> <td class="table_results">' . $row['FK_company_id'] . '</td> <td class="table_results">' . $row['job_status'] . '</td> <td class="table_results">' . $row['pcnt_complete'] . '</td> <td class="table_results">' . $row['FK_contractor_id'] . '</td> </tr> </div>'; } } ?> <? echo'<html> <head> <link href="forms_css.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> </body> </html>'; ?> And then when a row is clicked on it opens up the "job profile page" but currently i am only getting data displayed into the profile when i click on the first row of data but when i click on any other row i still get just the first row that it put into the profile?? Do i need to put the data into an array [0] on the PAGE ABOVE? Below is my job profile page code which should show data collected form the row that was clicked on previously: <? echo'THIS IS THE JOB PROFILE PAGE'; if ($log_in = true){ $db_name = ""; $table_name = "job"; $connection = @mysql_connect("localhost", "", "") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT * FROM $table_name WHERE job_id = [job_id]"; $result = @mysql_query($sql) or die(mysql_error()); echo'$GET_[job_id]'; while ($data=mysql_fetch_array($result)) { echo'<P>JOB ID:' . $data['job_id'] . '</P> <P> JOB NAME:' . $data['job_name'] . '</P> <P>COMPANY NAME:' . $data['company_name'] . '</P> <P> COMPANY ID:' . $data['company_id'] . '</P> <P> CONTACT FORENAME:</P>' . $data['contact_fname'] . '</P> <P> CONTACT SURNAME:</P>' . $data['contact_sname'] . '</P> <P> JOB STATUS:</P>' . $data['job_status'] . '</P> <P> COMPLETE PERCENTAGE:</P>' . $data['pcnt_complete'] . '</P> <P> CONTRACTOR:</P>' . $data['contractor'] . '</P> '; } } ?> <html> <head> </head> <body> P </body> </html> Hope this helps you understand at what ii am trying to do Thank you for your time given so far, very much appreciated C¬Rose
  13. Thanks for the replies, i have tried to use the method that you both instructed and keep getting a parse error at line 17... im guessing its the quotes and how i have set them? <? echo'THIS IS THE JOB PROFILE PAGE'; if ($log_in = true){ $db_name = ""; $table_name = "job"; $connection = @mysql_connect("localhost", "", "") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT * FROM $table_name WHERE FK_company_id = '$row[company_id]'"; $result = @mysql_query($sql) or die(mysql_error()); $data=mysql_fetch_array($result) echo'<P>JOB ID:</P>' . $data['job_id'] . '</P> <P> JOB NAME:</P>' . $data['job_name'] . '</P> <P>COMPANY NAME:</P>' . $data['company_name']'</P> <P> COMPANY ID:</P>' . $data['company_id']'</P> <P> CONTACT FORENAME:</P>' . $data['contact_fname']'</P> <P> CONTACT SURNAME:</P>' . $data['contact_sname']'</P> <P> JOB STATUS:</P>' . $data['job_status']'</P> <P> COMPLETE PERCENTAGE:</P>' . $data['pcnt_complete']'</P> <P> CONTRACTOR:</P>' . $data['contractor'] . '</P> '; } ?>
  14. Hey thanks for the reply, I have tried a script to display the information from the table and it does not display the [] just the text? Could you tell me where i am going wrong with this Cheers C¬Rose <? echo'THIS IS THE JOB PROFILE PAGE'; if ($log_in = true){ $db_name = ""; $table_name = "job"; $connection = @mysql_connect("localhost", "root", "") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT * FROM $table_name WHERE FK_company_id = '$row[company_id]'"; $result = @mysql_query($sql) or die(mysql_error()); $data=mysql_fetch_array($result); echo'<P>JOB ID:</P>'; $data['job_id']; echo'<P> JOB NAME:</P>'; $data['job_name']; echo'<P>COMPANY NAME:</P>'; $data['company_name']; echo'<P> COMPANY ID:</P>'; $data['company_id']; echo'<P> CONTACT FORENAME:</P>'; $data['contact_fname']; echo'<P> CONTACT SURNAME:</P>'; $data['contact_sname']; echo'<P> JOB STATUS:</P>'; $data['job_status']; echo'<P> COMPLETE PERCENTAGE:</P>'; $data['pcnt_complete']; echo'<P> CONTRACTOR:</P>'; $data['contractor']; } ?>
×
×
  • 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.