cobalt-rose
Members-
Posts
20 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
cobalt-rose's Achievements
Newbie (1/5)
0
Reputation
-
Yer i googled it and could only find books that taught you how to program :s
-
Thanks of the reply, but is there not any literature about it at all? or is it just a common fact. Thanks again
-
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
-
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
-
anybody with any advice at all?
-
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
-
Exporting mysql data to word (mail merge) or PDF files
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
o ok ill ask in the php section. do you know were i could find one though? thanks -
Exporting mysql data to word (mail merge) or PDF files
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
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. -
Exporting mysql data to word (mail merge) or PDF files
cobalt-rose posted a topic in PHP Coding Help
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 -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
Yes i do have a row that auto increments...so i do have a unique field -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
How can i get unique values into the data table? do i have to use an array? -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
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? -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
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 -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
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> '; } ?> -
Need help in getting 'id' from my table
cobalt-rose replied to cobalt-rose's topic in PHP Coding Help
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']; } ?>