Jump to content

andy_b42

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

About andy_b42

  • Birthday 11/13/1986

Contact Methods

  • MSN
    andy_b42@hotmail.com

Profile Information

  • Gender
    Male
  • Location
    ENG

andy_b42's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can you provide more details of all of the fields in your tables.
  2. Correct me if i am wrong, but i believe adding in a WHERE clause requires that arguments be supplied, i think the code above would just error as soon as the database attempted to execute the query. gple, if you remove your where clause completely, youshould get back all of the results in the table e.g. mysql_query("select * from table")
  3. Actually, unless i am missing something, this sql string doesnt ask for the image_url field from the database $sql = "SELECT Title,Content,Date FROM Posts ORDER BY id DESC";
  4. Can you try adding in the line: echo $pic; just after: $pic = $feed['image_url']; to see what url you are actually putting into the img tag
  5. By the looks of it, there are 4 "{" in this section and only 3 "}", i suspect it has something to do with the line "if(mysql_num_rows($fixtures)==0) ", not really read through what your code is trying to do though <?php if (isset ($message)) { echo($message); } else { echo('<form method="post" action="add_report.php">'); echo('<table>'); echo ('<tr><td><select name="match"><option>Please select Fixture</option>'); $fixtures=mysql_query('SELECT * FROM `tbl_fixture_dates` INNER JOIN `tbl_fixtures` ON `tbl_fixture_dates`.`date_id` = `tbl_fixtures`.`date_id` WHERE `tbl_fixtures`.`team_id` = \'' . $_GET['team_id'] . '\' order by match_date'); if(mysql_num_rows($fixtures)==0) echo('<option>there is no data in table..</option>'); else { while($matchrow=mysql_fetch_assoc($fixtures)) { echo "<option value=".$matchrow[match_id].">".date("d-M-Y", strtotime($matchrow[Date]))."|".$matchrow[Opposition]."</option>"; } } echo ('</select></td></tr>'); echo('<tr><td><input name="title" type="text" value="Enter Headline Here..." size="70" class="button"/></td></tr>'); echo ('<tr><td>'); $oFCKeditor = new FCKeditor('fcktext'); $oFCKeditor->BasePath = "includes/fckeditor/"; $oFCKeditor->Value = ""; $oFCKeditor->Width = 540; $oFCKeditor->Height = 400; echo $oFCKeditor->CreateHtml(); echo ('</td></tr>'); echo ('<br /> '); echo('<tr><td><input type="hidden" name="submit_form" value="1" /> </td></tr> <tr><td><input type="submit" value="Save Post" class="button"/> </td></tr> </table> </form>'); ?>
  6. and also the two similar ones below: <?php echo $myrow["title"] ?> <?php echo $myrow["who"] ?>
  7. on quick glance i would say this line: <input type=hidden name="id" value="<?php echo $myrow["id"] ?>"> needs a ";" after echo $myrow["id"]
  8. http://uk.php.net/round something like: round($value, 2);
  9. Solved, i was joining my tables on the table name and not the constraint name (which is where i should have been joining). Incase this is of use to anyone: SELECT kcu.COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu ON tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME WHERE tc.CONSTRAINT_TYPE = 'PRIMARY KEY' AND tc.TABLE_NAME = 'table1'
  10. I've been looking how to find the Primary Key of a table similar to the mysql equivalent of something like show keys from table1 where Key_name = 'primary' So far i have got this stage: SELECT kcu.COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc on kcu.TABLE_NAME = tc.TABLE_NAME WHERE tc.CONSTRAINT_TYPE = 'PRIMARY KEY' AND kcu.TABLE_NAME = 'table1' However, if the table contains a Foreign Key field that is a Primary Key on a nother table, it returns it in the query. Does any one know of a way to return ONLY the Primary Key of a table and nothing else? Thanks
  11. Im not familiar with fusionchart, but if you are wanting to write the contents of the query result to an XML file, you can use the XMLwriter classes, but i prefer for smaller xml files to just output a file formatted as XML as though i were making a text. <?php $xml = "<?xml version = '1.0' encoding = 'UTF-8'?>\n"; $xml .= "<container>\n"; $xml .= "\t<parent name=\"some value\">\n"; $xml .= "\t\t<child variable=\"some value\">\n"; $xml .= "\t\t<child variable=\"some value\">\n"; $xml .= "\t</parent>\n"; $xml .= "\t<parent name=\"some value\">\n"; $xml .= "\t\t<child variable=\"some value\">\n"; $xml .= "\t\t<child variable=\"some value\">\n"; $xml .= "\t</parent>\n"; $xml .= "</container>\n"; $openFileToWrite = fopen("myXML.xml", "w"); fwrite ($openFileToWrite, $xml); fclose ($openFileToWrite); ?> Very quick and very dirty, but it works. If your xml files are going to be quite big or you are using this sort of thing a lot, you should consider looking into the appropriate classes designed for writing xml files as this method can quickly become a pain to deal with.
  12. Sorry, i completely missed that. Have you tried using an inner join?
  13. andy_b42

    Unlink

    Why is there a "/" after the filename? That will cause the machine to read dargil.pt as a folder and not a file.
  14. When you do your join, you need to say on what field the tables join. So your join will be something like: SELECT o.oHOUSE,o.oWILL,o.oRENTED,o.oIMAGE,o.oUPGRADES,o.oID,o.oOWNER FROM `house_owned` `o` LEFT JOIN `house_rentals` `r` on r.rOWNER = o.OWNER I am not fully sure i understand what you are trying to achieve, but really you should specify how the tables are linked in a join.
  15. Are oOWNER and rOWNER equivalent fields?
×
×
  • 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.