Jump to content

joe1986

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

joe1986's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have just realised one of the problems. The two other tables I am trying to access are not included as part of the SELECT, however I have included these tables but MySQL still throws an error.
  2. Hi there, Im using mysql Ver 14.12 Distrib 5.0.75 and im having a problem writing a specific statement within a php page. The code is as follows: $q = "SELECT c.id_case, c.title, c.status, c.date_creation, fu.*, a.name_first, a.name_middle, a.name_last FROM lcm_case as c, lcm_followup as fu, lcm_author as a, lcm_case_author as ca WHERE c.id_case=fu.id_case AND fu.id_author=a.id_author AND ca.id_case=fu.id_case AND ca.id_author=fu.id_author"; if (strlen($find_followup_string)>1) { // Add search criteria $q = "SELECT * FROM lcm_followup WHERE ((id_followup LIKE '%$find_followup_string%') OR (type LIKE '%$find_followup_string%') OR (description LIKE '%$find_followup_string%')) AND c.id_case=fu.id_case AND fu.id_author=a.id_author AND ca.id_case=fu.id_case AND ca.id_author=fu.id_author"; Sorry, there is a small amount of PHP code there, but just to demonstrate what I need. Simply, I have one SQL statement which is executed if there is no search term in a PHP search box (This runs fine), and another which is supposed to run when there is a search term present. This runs fine if I dont include the AND statements but I dont get the results I need from the other two tables. The error message I am getting is: I am using 3 tables named, lcm_followup, lcm_case and lcm_author Can anybody help?
  3. I havent defined any primary or foreign keys in the table. I have decided to leave the idea now, and to just display an image from the link in a database. Not sure how to do this, but im sure there are tutorials available. If anybody knows of any, please let me know! Cheers
  4. Hi there, I am currently developing a localhost php application to retrieve report details, etc. from a mysql database. I have an idea at the moment for uploading images to one table in the database (links not blobs) and taking a field from another table comparing the contents of this particular field to the images names in the images table, and if there any matches (or similar) then to display within the PHP page. For example: Table 1 +---------------------------+ | Field 1 | Field 2 | |data123 | data456 | +---------------------------+ Table 2 +----------------------------+ | Field 1 | Field 2 | |data123.jpg | diff.jpg | +----------------------------+ data123 from one table matches data123.jpg from the other table, so that image is displayed. Im not sure how to implement something like this, although I suspect it might be simple "if field = to field then display, else dont" sort of thing...I hope this sort of makes sense. Any suggestions? Cheers Joe
  5. Ahhh right, I get it. Thanks very much for helping, despite it not being a PHP problem. Cheers, Joe
  6. Thanks for the quick reply. It is to be displayed on a webpage within a html table. Im not quite sure where to insert the or how to manually add the space in. I tried the strpad code you suggested, but no luck. any suggestions? thanks again for the reply. Joe
  7. Hi there, I think its a bit of a simple one really but im a PHP newbie. Im trying to put a space in between the output values (shown below) and I thought the ." ". in the middle would solve this problem, but it turns out not; and im pulling my hair out. The code I have for output reads: while ($row = mysql_fetch_array($result)) { echo " ".$row{'subject'}." ".$row{'data'}."<br>"; and the output is displayed as: "Subject Data" I want to put more spaces in between these two values, e.g. "Subject _________ Data" (obviously without the _) Could anybody please help me? Cheers, Joe
×
×
  • 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.