Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
mysql_num_rows
- Page 1
OpenAI o3 vs Anthropic Claude 4 for Text Classification & Summarization
Programming
Computer Science
6 Days Ago
by usmanmalik57
[OpenAI](https://openai.com/) and [Anthropic](https://www.anthropic.com/) are two AI giants delivering state-of-the-art large language models for various tasks. In a [previous article](https://www.daniweb.com/programming/computer-science/tutorials/542132/comparing-gpt-4o-vs-claude-3-5-sonnet-for-zero-shot-text-classification), I compared OpenAI GPT…
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
I already read that article, as well as related ones such as [this](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-wait-tables.html) and [this](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-event-tables.html) but it all went above my head and didn’t seem to directly answer my question. For example, when I currently run …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
I can see your rationale, but I don't necessarily agree with a separate table in the database for every month. There are much more elegant ways of handling that use case these days, especially in MySQL. You didn't specify how long ago this was. Either way, still hoping a MySQL expert can come along and answer my question here.
Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
How can I identify and delete unused MySQL indexes? I have a large table that has somehow accumulated way too many indexes over the years, and I'd now like to identify and delete indexes that are no longer used by the application.
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
OK, so I found [this blog post](https://www.percona.com/blog/basic-housekeeping-for-mysql-indexes/) by the one and only Percona, that says that I can simply do `select * from sys.schema_unused_indexes;` which does give me a list of indexes. However, it says it's based on having: update performance_schema.setup_consumers set enabled = 'yes' …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Reverend Jim
I thought it would be as simple as DROP INDEX index_name ON table_name; As for removing only unused indexes, I don't know how MySql would be able to determine if an index is used, or not. You'd have to decide. Since indexes are used to find things quickly I would imagine that if you delete an index and then take a performance hit it's …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
As some general background, that's the syntax to delete an index, of course, but MySQL knows if an index is used because, well, it's the one that uses it, and it tracks that stuff internally. Now on to my question ... ;)
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Reverend Jim
See [performance-schema-consumer-filtering](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-consumer-filtering.html)
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by toneewa
Your data wouldn't be accurate and incomplete, if either one of the performance schemas were off. event_waits_current was off, so MySQL didn't store the data (e.g., collect wait event data in detail), which can create incomplete or missing information about index usage like table I/O waits, index access details, event metadata, or timing and …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Reverend Jim
>Is that list incomplete or straight-up wrong? I have no way of knowing. If I add a bunch of numbers and get an answer, is it right or wrong? Again, as a guess, if you have enabled the correct flags and let the system run through typical processing, the returned list should be, according to the docs, a list of unused indexes. Worst case …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
Creating and removing database indexes is very complex and is not a matter of let's throw spaghetti at the wall and see what sticks. When working with big data, loads and loads of thought goes into each and every index. Nearly all indexes can work, but not as well as others might, and having too many indexes on a table can slow down inserts and …
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Reverend Jim
I faced a similar problem when I created and maintained the corporate side databases to mirror the EMS (AGC/SCADA) real time data. One month of data was roughly 300 meg and it was critical that this be available 24x7. Sometimes databases break and it is important to recover them as quickly as possible. Knowing that around 90% of the queries were on…
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Reverend Jim
>You didn't specify how long ago this was. 1998-1999
Re: Delete unused MySQL indexes
Programming
Databases
1 Month Ago
by Dani
> Your data wouldn't be accurate and incomplete, if either one of the performance schemas were off. Do you mean `!(accurate && incomplete)` or do you mean `!accurate && incomplete`? But I gotcha. Thank you for the explanation.
Evaluating OpenAI GPT 4.1 for Text Summarization and Classification Tasks
Programming
Computer Science
2 Months Ago
by usmanmalik57
On April 14, 2025, OpenAI released [GPT-4.1](https://openai.com/index/gpt-4-1/) — a model touted as the new state-of-the-art, outperforming GPT-4o on all major benchmarks. As always, I like to evaluate new LLMs on simple tasks like text classification and summarization to see how they compare with current leading models. In this article, I will…
Re: Optimizing working with big data
Programming
Software Development
2 Months Ago
by Dani
> What is large? Are we in the TB range or mere handfuls of GB? For the sake of argument, let's use my use case and say dozens of gigs and millions of rows. > How often do you need to do this? Is it once a day, once a month, or just once. For me, the most important is real-time read and write performance to tables with millions of …
Re: The Impact of User Research on UX Design
Digital Media
UI / UX Design
2 Months Ago
by john_111
I once visited a website where there were 20 rows, each composed of 20 identical small white squares (about the size of this --> HH ), with a tiny arrow in the bottom quarter corner to indicate they were links. But no text anywhere. Can you imagine how hard it would be to remember which button took you to which page, several days later? This…
Re: which language do i start leaning in 2025
Programming
Software Development
2 Months Ago
by Dani
It depends what you’d like to build. If a simple website, you can use HTML and CSS. Want some interactivity? Add JavaScript. Want to create more complex dynamic websites? You will need a backend language such as PHP and a database such as MySQL. I see you also tagged this topic c++. C++ is a popular language used for non-web related …
Re: Question/Answering over SQL Data Using LangGraph Framework
Programming
Computer Science
2 Months Ago
by Pelorus_1
Through its combination of natural language processing and structured query generation, LangGraph makes interfacing with databases and extracting insights over SQL data easier than ever.
Re: Buggy career talk :-P
Programming
2 Months Ago
by Salem
This https://en.wikipedia.org/wiki/Peterson%27s_algorithm Plus two different kinds of processors. Plus an error rate of less than once a week. After many months, the cause was eventually captured on a bus analyser. After which, the solution was obvious after a bit of RTFM. Turned out that one of the processors had the then awesome new …
MySQL Num Rows Inside a Loop
Programming
Web Development
14 Years Ago
by BlueCharge
…']; $selectcount = ("SELECT * FROM refferals WHERE refferer = '$current'"); $fetchall =
mysql_num_rows
($selectcount); echo $current; echo " | "; echo $fetchall; } ?> [/code…
Re: MySQL Num Rows Inside a Loop
Programming
Web Development
14 Years Ago
by boorsekala
use select COUNT(...)AS referals_num from ...... is better than num_rows and use one sql command instead of tow same discint or select count()AS ..... GROUP BY if your page is loaded more in one day try to cach result to another table and run file cacher every 5min by cronjob in cpanel or webmin or whm(if dedicate) php -q /fixtable.php or php -q…
Re: MySQL num rows error
Programming
Databases
16 Years Ago
by missaaliyah
… lines and the results were. Tested: $total=
mysql_num_rows
($return); [icode] MySQL said: #1064 - …for the right syntax to use near '$TOTAL=
mysql_num_rows
($return)' at line 1 [/icode] Tested: …,$limit"; $return=mysql_query($query,$link); $total=
mysql_num_rows
($return); $sess_id="PHPSESSID=".session_id(); [icode]…
MySQL num rows error
Programming
Databases
16 Years Ago
by missaaliyah
…linking back to the site. [icode]Warning:
mysql_num_rows
(): supplied argument is not a valid MySQL …icode] This is Line 34 [code=language]$total=
mysql_num_rows
($return);[/code] This is Lines 32 - 35…,$limit"; $return=mysql_query($query,$link); $total=
mysql_num_rows
($return); $sess_id="PHPSESSID=".session_id();[/code] I…
Re: MySQL num rows error
Programming
Databases
16 Years Ago
by nav33n
The error is because there is something wrong in your query. Print the query, execute it in mysql console or phpmyadmin. (Also post it here) :)
Re: MySQL num rows error
Programming
Databases
16 Years Ago
by missaaliyah
It's reply is practically the same as before I think. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$query="SELECT * FROM dir_site_list WHERE site_sponsor='N' AND site_live='Y' ORD' at line 1
Re: Mysql num rows(): Invalid argument
Programming
Web Development
19 Years Ago
by Troy
[b]Troubleshooting 101[/b] When troubleshooting code problems, the secret is baby-steps. When you have an error, it is always a single statement (or line) that is producing the error. Create a new file, and put in only enough code to produce your problem, then work until you solve it--one line at a time. Baby-steps. In keeping with the baby-steps…
Mysql num rows(): Invalid argument
Programming
Web Development
19 Years Ago
by Yuki H.
…quot;.$_GET["iid"]; $result = mysql_query ($sql, $conn); if (
mysql_num_rows
($result)>0) { $row = @mysql_fetch_array ($result) or die (…ORDER BY image_date DESC"; $result = mysql_query ($sql, $conn); if (
mysql_num_rows
($result)>0) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $i…
Re: Mysql num rows(): Invalid argument
Programming
Web Development
19 Years Ago
by Troy
For your mysql error, test your SQL statement. Right after your line that builds your SQL statement, do this: [PHP] echo $sql; exit(); [/PHP] Examine the output to see if something is wrong with the SQL statement. Try running it directly against your database using phpMyAdmin or the command line client. For your fopen error, as you know, it …
Re: MySQL Num Rows Inside a Loop
Programming
Web Development
14 Years Ago
by hielo
On line 7, you forgot to execute the query. You need to use mysql_query(): [CODE] ... $selectcount = mysql_query("SELECT * FROM refferals WHERE refferer = '$current'") or die( mysql_error() ); ... [/CODE]
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC