Jump to content

chico1st

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by chico1st

  1. i tried to do this with update 128000 times and it appears that the speed bottle neck was UPDATE and not any of those C functions.
  2. acutally this is in C so here is my code: for (i=1; i<= 128000; i++){ strcpy(query, "INSERT INTO StartData (INDEX1) VALUES ("); ltoa (i,query2,10); strcat(query, query2); strcat(query, ")"); if (mysql_query(conn, query)) { fprintf(stderr, "%s\n", mysql_error(conn)); exit(0); } }
  3. i have to create a table and i have to create an index for it, truncate the table, index it... its rather slow because i have 128000000 rows is there a faster way than to go : INSERT INTO StartData (INDEX1) VALUES (i) 128000000 times? *i being a counter*
  4. chico1st

    autoindex

    what is the sql command to do auto index? i have an index column and i need to fill it with numbers from 1-128 000 000 i cant find anything on mysql.com also can i quickly empty a lot of values out of a table but leave the index column? or should i re auto index it once i empty out my table? i know i can delete from table but would emptying the table and re-indexing it be quicker?
  5. Hi I am having an issue with a database I have that holds pictures I just read pictures in as long blobs and a table in MySQL holds them but I have just run into a FATAL ERROR Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1736612 bytes) in D:\wamp\phpmyadmin\libraries\common.lib.php on line 2418 Can I increase this size? or do I have to change teh entire way that I hold pictures.
  6. Hi I was wondering how I can turn a string that is "05" into a string that is "5" Thanks
  7. Here is the code that Im using $userName = "ccem"; $serverName = "localhost"; $password = ""; $dbConn = mysql_connect($serverName, $userName, $password);
  8. Okay I havent touched phpMySQL in a long time but I loaded up a previous site that I made to make an adjustment. But im getting this error Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ccem'@'localhost' (using password: YES) in D:\wamp\www\Lib.php on line 31 problem connecting to database... Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\wamp\www\Lib.php on line 38 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in D:\wamp\www\Lib.php on line 38 Access denied for user 'ODBC'@'localhost' (using password: NO) What am I doing wrong? How do I check what password im supposed to by using?
  9. it was ugly but it worked thanks
  10. I cant import my database, it is 2.3MB but my phpmyadmin wont let me import anything larger than 2MB. Is there any way that I can change this? This is the error that I get when I attempt to import. Error No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16. Im using Apache 2.2.4 PHP 5.2.1 + PECL SQLitemanager MySQL 5.0.27 Phpmyadmin Thank you very much for your time.
  11. Im always curious about the advantages of certain programs. What is the advantage of this?
  12. ima teen! we are everywhere.. you meet them all in your programming classes in high school. and you form friendships as you try to make the server into a vast gaming resource!
  13. chico1st

    phpmyadmin

    i get this error when i make an index table in phpmyadmin: "PRIMARY" must be the name of and only of a primary key! does this mean anything to you this was the sql to create my index table CREATE FULLTEXT INDEX full_index ON news(   name ,   abstract ,   coresearch   ); any idea what it means?
  14. ive noticed that i can make more than one index. the one that the search seems to default to is 'full_index' can i make more than one index then just point my search at different index's? also i eliminated  the text area and just left the title, abstract,... 4 fields in total... it officially doesnt work.. but there is no error here is the query: $sql = "SELECT research.researchID, research.name AS research, research.coresearch, research.affiliation, research.abstract, research.fulltext, date.name AS date, author.name AS author,               MATCH(research.name, research.abstract, research.coresearch, research.affiliation)               AGAINST ('$searchstring') AS score FROM research, date, author               WHERE MATCH(research.name, research.abstract, research.coresearch, research.affiliation)               AGAINST ('$searchstring')   AND date.dateID = research.dateID AND author.authorID = research.authorID   ORDER BY score DESC"; this is what its searching:   research name: More crazy research abstract: The plague is bad co-researcher: botton affiliation: school it has 9 words to search and if i type in any of them it wont find the article.. are all the words occuring too often?
  15. well i did make my own index but i want to be able to search the title OR the abstract OR the fulltext okay.. well that just means that the inaccuracy is out of my control :P which is good news... take that users!
  16. okay i have a full text search, it works, and here is the query $query = "SELECT news.newsID, news.name AS news, news.abstract, news.fulltext, date.name AS date, author.name AS author,               MATCH(news.name, news.abstract, news.fulltext)               AGAINST ('$searchstring') AS score FROM news, date, author               WHERE MATCH(news.name, news.abstract, news.fulltext)               AGAINST ('$searchstring')   AND date.dateID = news.dateID AND author.authorID = news.authorID   ORDER BY score DESC"; but even if i know a certain word is in the entry im searching, often i wont get any articles coming up as results. Is there anything that might cause this like the 50% threshhold? or blocked words? for instance if I search 'database' i get a result, yet right next to it is the word 'available' but if i type that in there are no results Any idea why? ALSO!  if i want to make a certain field more sensitive would I have to make it its own table.. like a title table? or can i just choose to search that field? i know i have to have the same fields in my select as are in my index table so i cant just not include a field as far as i know THANKS!
  17. whoa .. phpmyadmin has an empty table button.. sweet!
  18. is there a restart database command? once I have everything working i would like to restart my database to get all the erroneous entries out of my tables.
  19. well i couldnt get a result from it so i figured the syntax was wrong.. but if i need an alias thats that :D
  20. if i change from innoDB to myIsam what will change? will I have to modify my code? ive looked into replication and i dont think i want to deal with that the speed of my inserts/updates really doesnt matter to me because i have very low traffic but i keep hearing the word reliable thrown around, which is important.. i dont want my db's dieing on me. however i feel like reliability means something different in the database world.. just because that seems to be the trend :P
  21. I have all innoDB tables but i need to do a fulltext search, I have search and read a lot but all of them need a FULLTEXT INDEX which i would create by going like this: CREATE FULLTEXT INDEX full_index ON `news`(   `name` ,   `abstract` ,   `fulltext`   ); but i get this error: 'The used table type doesn't support FULLTEXT indexes ' is there an innoDB equivalent or have I destroyed all my chances of searching? THANKS FOR ALL THE HELP!
  22. this works but can i make this where command less.. gigantic? <?php //add a where condition of a certain author/topic/both [b]if($postAuthor = $_POST['author']){ if($postTopic = $_POST['topic']){ $where = "AND news.authorID = '$postAuthor' AND news.topicID = '$postTopic'"; }else{ $where = "AND news.authorID = '$postAuthor'"; } }else{ if($postTopic = $_POST['topic']){ $where = "AND news.topicID = '$postTopic'"; }else{ $where = ""; } }[/b] //add an ORDER BY condition of author/date/topic if($_POST['sort'] == 'author'){ $sort = "author,"; }elseif($_POST['sort'] == 'topic'){ $sort = "topic,"; } $query = "SELECT news.newsID,  news.name AS newsName, news.abstract, " . "date.name AS date, topic.name AS topic, author.name AS author " .         "FROM news, date, topic, author " .         [b]"WHERE news.authorID = author.authorID AND topic.topicID = news.topicID AND news.dateID = date.dateID $where " .[/b] "ORDER BY $sort date"; $result = mysql_query($query) or die($query."<br />\n".mysql_error()); if(mysql_num_rows($result) == 0){ $output = "Database is empty <br>"; }else{ $output = "<table>"; while($row = mysql_fetch_assoc($result)){ $newsid = $row['newsID']; $title = $row['newsName']; $abstract = $row['abstract']; $date = $row['date']; $topic = $row['topic']; $author = $row['author']; $output .= "<tr><td>"; $output .= "<a href='news_article.php?id=$newsid'>$title</a><br>"; $output .= "<em>$abstract</em></td>"; $output .= "<td>$topic</td>"; $output .= "<td>$author</td>"; $output .= "<td>$date</td>"; $output .= "</tr>"; } $output .= "</table>"; } print $output;   ?>
  23. i usually dont but when things go wrong i kind of just throw them in, i used to think it was a good idea.. but now i know and knowing is half the battle... GI JOE!
  24. what does it mean when you get this error from mysql_error()? MySQL server has gone away
  25. thanks a tonne! i dont know the syntax of a lot of things like that.. i just kindof toss backticks in when i feel like it.. its bad  but im getting better!
×
×
  • 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.