vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [Urgent] - Little Assistance Needed (https://vborg.vbsupport.ru/showthread.php?t=49208)

Dean C 02-22-2003 12:43 PM

[Urgent] - Little Assistance Needed
 
Hi,

Thanks to my good friend Stefan (Xenon) he has kindly taken some of his free time to write me a script for a maths project for college.

I've already taken too much of his time so i feel guilty in asking him to make on final modification.

Basically i have this query:

[sql]
SELECT title FROM word ORDER BY RAND() LIMIT 100
[/sql]

It selects 100 random words from the word table. Now the problem with the word table is that it picks up mistakes and adds them. For example things like this would appear in the table:

one...day

________

Now i want it to just ignore these and also to ignore words with apostrophes and dashes etc. So basically i only want it to select words that consist of the 26 letters in the alphabet and no extra characters. Can someone modify that query above to do that for me :)

Thanks in Advance

- miSt

Dean C 02-22-2003 05:58 PM

Ok after a little help from a friend i found something like this would kind of work:

[sql]
SELECT title FROM word WHERE title REGEXP "[a-zA-Z]" ORDER BY RAND(NOW()) LIMIT 100
[/sql]

Now i have no idea how or why it works. But it doesn't work 100%. I still had an entry appear which was this:

ben."

Also i noticed 'arent' in the list so i'm not sure if this mysql thingy in that query is stripping apostrophes or what.

Does anyone have any ideas :)

Thanks

- miSt


All times are GMT. The time now is 01:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00897 seconds
  • Memory Usage 1,705KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete