Jump to content

chico1st

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by chico1st

  1. CREATE TABLE `news` (\n  `newsID` smallint(4) NOT NULL auto_increment,\n  `dateID` varchar(5) NOT NULL,\n  `authorID` smallint(4) NOT NULL,\n  `topicID` varchar(4) NOT NULL,\n  `pictureID` varchar(4) NOT NULL,\n  `name` varchar(20) NOT NULL,\n  `fulltext` longtext NOT NULL,\n  `abstract` tinytext NOT NULL,\n  PRIMARY KEY  (`newsID`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1
  2. ok wow.. that mysql_error() thing is amazing i wish i knew about that before SELECT `news.newsID`, `news.authorID`, `news.topicID`, `news.name`, `news.abstract`, `news.fulltext`, `date.name` FROM `news`, `date` Unknown column 'news.newsID' in 'field list' newsID is definatly a field in my news table
  3. something is wrong with my WHERE statement :S This looks right to me "SELECT news.newsID, [b]news.authorID AS newsAuthor[/b], news.topicID AS newsTopic, news.name AS newsName, news.abstract, " . "news.fulltext, date.name AS date, topic.name AS topic, author.name AS author " . "FROM news, date, topic, author " . [b]"WHERE newsAuthor = 1";[/b] $result = mysql_query($query) or die('Error, query failed'); I get 'Error, query failed' there is an entry that matches this but it shouldnt say that even if there isnt an entry Thanks for any help you may offer!
  4. heres what i have $query = "SELECT news.newsID, news.pictureID, news.name AS newsName, news.abstract, [b]left('news.fulltext',100)[/b], date.name " .   "FROM news, date WHERE news.dateID = date.dateID ORDER BY date.name"; i tried this too $query = "SELECT news.newsID, news.pictureID, news.name AS newsName, news.abstract, [b]left(news.fulltext,100)[/b], date.name " .   "FROM news, date WHERE news.dateID = date.dateID ORDER BY date.name"; and i looked at these commands and found nothing http://www.mysqlfreaks.com/mysql_statements.php is there another manual? THANKS! PS the substr() works i just tried it but i figure this will process faster
  5. these dont seem to work for me... and i cant find them in the either the php or mysql manuals if im supposed to write them how do i take out one character of a string?
  6. what is FS? also im using an fopen command on my images, im assuming that is running them? which is bad THANKS!
  7. okay i have a pdf document in a database which i am downloading using this code. to take it out i use this code: [b]print "<a href='download.php?id=$id'>PDF!</a>";[/b] where download.php is : <?php if(isset($_GET['id'])) { // if id is set then get the file with the id from database include "../../Lib.php"; $dbConn = connectToSpy(); $id    = $_GET['id']; $query = "SELECT name, type, size, content " .         "FROM document WHERE documentID = '$id'"; $result = mysql_query($query, $dbConn) or die('Error, image retrieve failed'); list($name, $type, $size, $content) = mysql_fetch_array($result); header("Content-type: $type"); echo $content; exit; } ?> But i was wondering how i can make a link that directly makes you download the file instead of opening it?
  8. Okay i had a post yesterday but i figured out what the problem is therefore i have a new question, i had commands like $news_id = $row['[b]news.[/b]newsID']; whereas i needed $news_id = $row['newsID']; however this raises the issue that when i try to bring up the name of the news file i end up reading the name of the date. i want to say $name = $row[[b]'news.[/b]name']; but i have to say $name = $row['name']; which brings up the date's name how can i force my code to accept $name = $row[[b]'news.[/b]name']; here is the code: $query = "SELECT news.newsID, news.pictureID, [b]news.name[/b], news.abstract, [b]date.name[/b] " .   "FROM news, date WHERE news.dateID = date.dateID";   $result = mysql_query($query, $dbConn);     //print 2 most recent news articles   for( $i = 0; $i <2; $i++){ $output .= "\n<tr><td>"; $row = mysql_fetch_assoc($result); $news_id = $row['newsID']; i dont want to rename the elements of my table if it can be avoided $name = $row['name']; $abstract = $row['abstract']; $image_id = $row['pictureID'];
  9. Hey im having trouble with a join, as far as i can figure it should work but i get: [b]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Lib.php on line 206[/b] this worked fine before i tried to join it so i think that must be the problem [b]$query = "SELECT news.newsID, news.pictureID, news.dateID, news.name, news.abstract, date.dateID, date.name " .   "FROM news, date WHERE news.dateID = date.dateID ORDER date.name";[/b] $result = mysql_query($query, $dbConn);     //print 2 most recent news articles   for( $i = 0; $i <2; $i++){ $output .= "\n<tr><td>"; $row = mysql_fetch_assoc($result);         $news_id = $row['news.newsID']; $name = $row['news.name']; $abstract = $row['news.abstract']; $image_id = $row['news.pictureID'];       .... any help you can offer would be GGGGGRRREEAT!
  10. Is there any way to print lets say the first 100 characters of a text entry? To go along with this is there anyway to check the length of a text entry? Any help would be GGGGRRRRRREAT!
  11. okay.. that worked but it brought up another problem. On my template it shows one on my <td> columns being as wide as a picture help within it but on the page that comes from it, the <td> column is much wider, its very annoying. Ive made sure the table inside has a fixed width but that didnt help. and it did update. template: __ :D| ~~ page: ______ :(      | ~~~~ When i look at the template part of the code, on the page its correct. Any help would be GGGRRRRREAT! THANKS!
  12. how can I make it so that the <td>'s of my table make a sort of 100px,20px,THE LEFT OVER,20px,100px i thought it was * but it turns out i was wrong THANKS for any help you can offer :D
  13. upon reaching page i would like to read what a user has entered into a form, then with a php script send them to different pages depending on what they entered. is there a gotopage("magik.php"); command? THANKS for any help you can offer!
  14. yeah the valign solved it :D thanks!
  15. Hey this is just an html question. I have an image with border = 1, but i want it to be spaced away from the text that surrounds it. If I add an hspace it adds space on both sides but i only want space on one side, and align doesnt seem to solve this problem. Also when I add an hspace the border goes around that area too which looks really ugly. Any advice? Thanks a lot for any help you can offer!
  16. Okay ive never done this before but i need to make a link to a page which will bring up a database entry. lets say that i know the ID of the entry as $id does it just go? <A HREF=magicpage.php?id=$id>go here</a> which leads to magicpage.php where some of the code would be $id    = $_GET['id']; $query = "SELECT name, type, size, content FROM magicdatabase WHERE ID = '$id'"; sorry ive never dealt with this, and im away from MY computer so i cant test it. After this i should be out of your hair, and I cant tell you how thankful I am for all your help, you are all awesome people! :D THANKS for any help you can offer
  17. do you have any recommendations? what are these types of programs called? im searching but i dont know what to search for so it makes it harder.. for instance how do i get one that will work on my website?
  18. Hey i know how to upload pictures but i was wondering how to upload files like word documents? Idealy i would like to automatically convert them to PDF's, and extract the full text. The data base will also be small so im not too worried about efficiency Thanks for any help you can offer THANKS!
  19. i figured out that radio button grouping thing.. im blaming dreamweaver :P
  20. This is the 1st radio button [b]      <input name="rextopic" id="rextopic" type="radio" value="true" /></td>[/b] then i ahve some php <?php $query = "SELECT topicID, name FROM topic"; $output = "<td><select name='extopic' id='extopic' onClick=check('rextopic');>"; $result = mysql_query($query, $dbConn); while($row = mysql_fetch_assoc($result)){ $output .= "<option selected='$row[topicID]'>$row[name]</option>"; } $output .= "</select></td>"; print $output; ?>     </tr>   <tr>     <td>New Topic       here is the second radio [b]<input name="rnewtopic" id="rnewtopic" type="radio" value="true" /></td>[/b]
  21. Okay I have a form and I have 2 radio buttons on it Each radio button corresponds to a text box so I have a script that will check the buttons depending on which text box gets clicked but I have 3 problems. 1) I need the script to go off if you tab in as well 2) I need the other radio button to get unchecked if you check one but that doesnt do itself. 3) I have an uncheck function that I can use but i dont know how to put 2 functions into 1 onclick trigger. And it seems taht if i use 2 onclick functions the 2nd one doesnt trigger. Any help would be awesome THANKS A TONNE PS thanks for the help earlier corbin
  22. I have 2 radio buttons in a form. I was wondering how to trigger a button if someone clicks on a different part of the form, like in a text box? I searched it but i didnt know what to search for except "radio button" which gave me a million results THANKS!
  23. Hey i was wondering if there is a way to know the ID (auto_assigned primary key) of a value you just input. The only way I can think of... [i]unless there is a command.[/i].. is to just go through the whole table and note the very last ID. Any help would be great! THANKS!
  24. i dont know why but yours works and mine doesnt.. it baffles me but im not going to fight it the reason i had the while was to shorten the #of loops, efficiency, but THANKS!
  25. Okay i just went to implement this and i realized that they are in different tables. The only solution i can think of is to read one month's worth of articles into an array. sort that array by author name then move on to the next month this would work but it seems very cumbersome Any ideas? THANKS!
×
×
  • 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.