pass data to another asp page Programming Software Development by Fergus_1 ok so i have a page with a gridview on it and it displays rows from sql table. i have also a link assigned to each row: <asp:GridView ID="GridViewMatters" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridViewMatters_RowDataBound"> <Columns> <asp:… Re: Improve HAVING BY performance Programming Databases by Dani But you're not comparing apples to apples. Your WHERE query and your HAVING query perform different calculations and do different things. In one, you're plucking out all the rows with a price greater than $4, and then calculating an average price for each product. In the other, you're plucking out *all* rows, calculating an average price for each … Re: Improve HAVING BY performance Programming Databases by Biiim > INSERT INTO electronics.products(ProductID, ProductName, Price) VALUES ('1','capacitors', 2.50), ('2','resistors', 4.50), ('3','rectifiers', 7.50), ('4','diodes', 10.00), ('5','ICs', 25.00), ... ('50000','...', ...); I don't see any mention of an index on it & your benchmark indicates you don't have one: ALTER TABLE `… Re: Improve HAVING BY performance Programming Databases by Biiim I realise this has been marked as solved, but I wanted to make it known that the HAVING clause runs on the returned result set of your query, which as you say has no indexes on it as it is just a temporarily created result set - but has the benefit of allowing you do do some simple post-processing on the result set. (This is for MariaDB at least)… Re: Improve HAVING BY performance Programming Databases by toneewa I know when you don't use aggregate calculations use WHERE. Producing the same results can be done. I added another test with MAX(Price). With a database over 305K rows, 3 columns, MySQL Workbench is unstable importing. Took over 2 hours. WHERE is faster, and should be used, when no functions are needed. WHERE Query execution time: 0.… Re: How to query database using variable and get all results not just one row Programming Web Development by Mikekelvin To ensure that you're retrieving all records associated with the current user, you need to make sure that your query accurately filters the data based on the user's identifier (variable_name). Here's how you can modify your query to achieve this: // Assuming $currentUser holds the identifier of the current user // Query database to retrieve … Re: How to query database using variable and get all results not just one row Programming Web Development by Chris_103 To retrieve all records associated with the current user, you can use the fetchAll() method instead of fetch(). Here's how you can modify your code: ```php // Query database to retrieve records associated with the user $sql = "SELECT * FROM table_name WHERE variable_name = :variable_name"; $stmt = $conn->prepare($sql); $stmt->… Extract Tabular Data from PDF Images using Hugging Face Table Transformer Programming Computer Science by usmanmalik57 In a previous article, I explained [how to extract tabular data from PDF image documents using Multimodal Google Gemini Pro](https://www.daniweb.com/programming/computer-science/tutorials/541449/pdf-image-table-extractor-web-app-with-google-gemini-pro-and-streamlit#post2296083). However, there are a couple of disadvantages with Google Gemini Pro. … Claude 3 Opus Vs. Google Gemini Vs. GPT-4 for Zero-Shot Text Classification Programming Computer Science by usmanmalik57 On March 4, 2024, [Anthropic](https://www.anthropic.com/) launched the [Claude 3 family of large language models](https://www.anthropic.com/news/claude-3-family). Anthropic claimed that its Claude 3 Opus model outperforms GPT-4 on various benchmarks. Intrigued by Anthropic's claim, I performed a simple test to compare the performances of Claude … PDF Image Table Extractor Web App with Google Gemini Pro and Streamlit Programming Computer Science by usmanmalik57 In my previous article, I explained [how to convert PDF image to CSV using Multimodal Google Gemini Pro](https://www.daniweb.com/programming/computer-science/tutorials/541365/converting-pdf-image-to-csv-using-multimodal-google-gemini-pro). To do so, I wrote a Python script that passes text command to [Google Gemino Pro](https://blog.google/… Re: Improve HAVING BY performance Programming Databases by Reverend Jim I'm not very familiar with HAVING but my understanding is that it is used to filter results after a GROUP operation so I can't imagine that indexes would improve performance other than on the original SELECT. Using WHERE would return rows based on one or more criteria, and would benefit from indexing, but HAVING, as I understand, is performed after… Re: Improve HAVING BY performance Programming Databases by Reverend Jim I have a friend who spent the better part of a career doing SQL. I wrote up your question and sent it off to him. Just for sh!ts and giggles, he decided to feed it to ChatGPT first. He said that what he got back was what he would have written if he spent a lot of time researching. Here is what ChatGPT said... >Yes, you're correct that … Re: How to disable the automatic swipe effect on the product page? Programming Web Development by Dani Hello, Google Search Console is showing that vidceo is not the main content of the page, because I don't see any video on [this page](https://www.kupisi.mk/product/index.php?mainCategory=%D0%B7%D0%B0-%D0%B4%D0%BE%D0%BC%D0%B0&productName=%D1%83%D0%BD%D0%B8%D0%B2%D0%B5%D1%80%D0%B7%D0%B0%D0%BB%D0%BD%D0%BE-%D0%BF%D0%B0%D0%BC%D0%B5%D1%82%D0%BD%D0… Re: mysqli query for no results again Programming Web Development by phorce This code: if($SM_pro){ Basically is saying if SM_pro == true, however, DM_pro is an array, so, therefore it won't return true/false. You could try: if($SM_pro <= 0) { Alternatively, you could use the mysqi_num_rows() function.. http://www.nusphere.com/kb/phpmanual/function.mysqli-num-rows.htm Hope this helps :) Re: MySQLi Help Programming Web Development by pritaeas See the [URL="http://php.net/manual/en/mysqli-stmt.num-rows.php"]manual[/URL] page. The num_rows function can only be used after store_results. See the example in the manual for the fix. Re: Num Rows Problem Programming Web Development by Atli A better approach would be to use the SQL `COUNT()` function to have the SQL server return the number of rows, rather than return the rows and count them in PHP. It's less wasteful. $sql = "SELECT COUNT(*) FROM `users` WHERE fname = %s"; $sql = sprintf($sql, mysql_real_escape_string($_POST["email"])); $… Re: MySQLi Help Programming Web Development by decade mysqli is much more easier to play than mysql. in your code 1.declare a connection; public $connect; 2.create a construct function. function __construct(){ $this->connect; } I use the $this so that it will call "connect" 3. create the query example INSERT STATEMENT: function newUser($data){ $qry = &… Paging issue in php for few corrupt rows excluded Programming Software Development by multicoder Hi, I have a strange situation to tackle.I have a paging for the website I am developing. there are few records in the table which i want to skip from to display in my list in the web page. But paging works on the total num rows as using mysql_num_rows(resultset) MySQL Num Rows Inside a Loop Programming Web Development by BlueCharge Hi Everyone, I am currently trying to list a leaderboard for refferals. The table is set up with the following columns: id | refferer | user So obviously if someone reffers someone else they will be in a new row so there are multiple rows per person. I am trying to use the following code which echos the user the loop is one but wont echo the … MySQLi Singleton Class Programming Web Development by joshmac I have a singleton class that I am revamping and need a little help with. I want to use the following syntax for my queries without having to declare a global object. Below is my current code: /** * The db database object * * @access private * @var object */ private $db; … mysqli query only returning one result but multiple rows in num_rows Programming Web Development by simplypixie I am not new to OOP I am tidying up a very large site of mine and trying to create a much better structure (more in keeping with the whole point of OOP). I have decided to use mysqli (please don't suggest PDO as I have decided againast it) which is new to me and am a little confused to say the least with a problem I am having with a basic select * … Re: mysqli query only returning one result but multiple rows in num_rows Programming Web Development by simplypixie It's OK, I am using a basic while loop (as I say I have got that working now where it wouldn't before and therefore don't need a foreach within it - did wonder why I would in the first place really) and allocating all rows to a new array and returning that. It is all working now. If anyone else has this problem, this is what I changed/got working:… MySQLi Help Programming Web Development by cuonic Hi, Just started to mess with MySQLi, created a simple login script, Connection to MySQL server establishes correctly, but then displays username is incorrect, because 0 rows were returned. 1) Am I doing it right, is the mysqli layout I'm using correct ? 2) Database structure is uid - username - password Code : [url]http://pastebin.com… Re: mysqli query only returning one result but multiple rows in num_rows Programming Web Development by DarkMonarch if i remember correctly mysqli return an object of arrays. so you need to run through arrays, then run again in the array. while($row = $query->fetch_assoc()){ foreach($row as $key => $value){ ... do something Re: mysqli query only returning one result but multiple rows in num_rows Programming Web Development by DarkMonarch wow my mind is fragmented today :( sorry about that. you started your post about query you need to put your query in () like so: $db = new mysqli($host, $user, $pass, $dbname) or die($error);// declare db $query = $db->query("SELECT * FROM sometable") or die($error);//use to query Re: mysqli query only returning one result but multiple rows in num_rows Programming Web Development by DarkMonarch return statement will break the function therefor the loop, so it probly return 1 array if place inside your doQuery function. unless you concatenate the data before returning. here what i did with a dynamic employee page: (its in french but doesnt matter) public function tableau(){ $db = new mysqli($this->host, $this->user, $… Re: mysqli query only returning one result but multiple rows in num_rows Programming Web Development by simplypixie My query is in () `$query = $this->dbh->query($sql);` However, I have just printed the $rows within the while loop and I have all my records showing now, thank you. Now to work out how to get the data to the index.php page and display it :-) Re: MySQLi Help Programming Web Development by cuonic Just set up a test page with just the mysqli stuff, and the script returns the correct password but $query->num_rows; returns 0. Why is this ? Mysqli insert parsed array containing original original tags Programming Web Development by denikov I would really like for someone to take a little time and look over my code. I'm parsing some news content and I can insert the initial parse into my database which contains the news URL and the title. I'd like to expand it farther, to pass along each article link and parse the content of the article and include it in my database. The initial … MySQLi Insert query Programming Web Development by bsewell Hi, I'm trying to write a program using mysqli, so I have created a login page. I've tried looking for how to get an Insert statement ran using MySQLi, object orientated style. So it looks like my query isn't working but I don't know why so I wondered if someone could help. My code is self-explanitory, I'm just using constants to connect to the …