Search Results

Search found 10177 results on 408 pages for 'thumbs db'.

Page 152/408 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • how to query sqlite for certain rows, i.e. dividing it into pages (perl DBI)

    - by user1380641
    sorry for my noob question, I'm currently writing a perl web application with sqlite database behind it. I would like to be able to show in my app query results which might get thousands of rows - these should be split in pages - routing should be like /webapp/N - where N is the page number. what is the correct way to query the sqlite db using DBI, in order to fetch only the relavent rows. for instance, if I show 25 rows per page so I want to query the db for 1-25 rows in the first page, 26-50 in the second page etc.... Thanks in advanced!

    Read the article

  • A typical lifecycle of a Hibernate object in a web app - ?

    - by EugeneP
    Describe please a typical lifecycle of a Hibernate object (that maps to a db table) in a web app. Suppose, you create a new instance of an object and persist in the db. But during the app lifetime you'll be working on a detached object and finally you need to update it in the database, for example on exit. How does it look like with hibernate and spring? p.s. Can transactions and sessions live between servlet transitions? So that we opened 1 session and use it in all servlets without a need to reopen it?

    Read the article

  • jQuery lightBox plugin, problem with first image

    - by torm
    Hi, for start sorry for my bad english... but i have a little problem with this plugin. http://leandrovieira.com/projects/jquery/lightbox/ - to be sure we know what i'm talking about. So... i've got an image gallery with thumbs, and everything goes well.. except... when i click on the first image... it shows - ok, but i can go to the next image by clicking "next". It's loading all the time. When i choose second image... everything is allright, and i can skip to the next images... but i also cannot go back to the first one.

    Read the article

  • PHP send batch email [closed]

    - by qalbiol
    Possible Duplicate: Sending mass email using PHP I have a PHP script that sends an individual email to all users in my DB, such as a monthly / weekly newsletter. The code I am using goes as follows: $subject = $_POST['subject']; $message = $_POST['message']; // Get all the mailing list subscribers. $query = $db->prepare("SELECT * FROM maildb"); $query->execute(); // Loop through all susbcribers, and send and individual email. foreach ($query as $row) { // Setting maximum time limit to infinite. set_time_limit(0); $newMessage = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> </head> <body>'; // Search for the [unsubscribe] tag and replace it with a URL for the user to unsubscribe $newMessage .= str_replace("[unsubscribe]", "<a href='".BASE_URL."unsubscribe/".$row['hash']."/".$row['email']."'>unsubscribe</a>", $message); $newMessage .= '</body></html>'; $to = $row['email']; // Establish content headers $headers = "From: [email protected]"."\n"; $headers .= "Reply-To: [email protected]"."\n"; $headers .= "X-Mailer: PHP v.". phpversion()."\n"; $headers .= "MIME-Version: 1.0"."\n"; $headers .= "Content-Type: text/html; charset=iso-8859-1"."\n"; $headers .= "Content-Transfer-Encoding: 8bit;"; mail($to, $subject, $newMessage, $headers); // Send email to each individual user } This code works perfectly with a REALLY small database... I recently populated my test db with 200k+ users, and obviously this script fails, gets out of memory, and dies... I know this is a bad way to send so many emails, thats why I'd like to ask you for much more efficient ways to do this! Thank you very much!

    Read the article

  • Data access layer design

    - by Sam
    I have a web app and a console application accessing a db. The db has 2 tables (A, B) one of which (A) is specific to the web app. When writing a data access layer, what is the best way to do it? Technically data access layer should provide access to all the data accessible. In doing so, methods to interact with A are exposed to the console application if we have single access layer. Does creating 2 access layers to 2 table in the same database makes any sense? What is a good way to do it?

    Read the article

  • JQuery .get() only passing first two data parameters in url

    - by The.Anti.9
    I have a $.get() call to a PHP page that takes 4 GET parameters. For some reason, despite giving the $.get() call all 4, it only passes the first two. When I look at the dev console in chrome, it shows the URL that gets called, and it only passes action and dbname. Heres the code: $.get('util/util.php', { action: 'start', dbname: db, url: starturl, crawldepth: depth }, function(data) { if (data == 'true') { status = 1; $('#0').append(starturl + "<ul></ul>"); $('#gobutton').hide(); $('#loading').show("slow"); while(status == 1) { setTimeout("update()",10000); } } else { show_error("Form data incomplete!"); } }); and heres the URL that I see in the developer console: http://localhost/pci/util/util.php?action=start&dbname=1hkxorr9ve1kuap2.db

    Read the article

  • PHP & MySQL Problem

    - by Fincha
    I Have a script, getting text from DB and post it on other DB. Problem is, if I have a Text lngen then 840 Words, I can't call this page. Get an error about "Not Found" or "Connection brocken" or what ever. In FF i get no error, only blank page. I found out the Problem is in lenght of the query i send... but how can i fix it??? My it be the Problem, if a query is longer then 6000 Characters?

    Read the article

  • MySQL text field issues

    - by chenger
    This is quite a noobish question, I have searched for a few hours now and I know this has to be simple. I am using XAMPP and I am trying to learn some more about using PHP and mySQL together. When I create the DB and the table for information to store, I tried insert info to the table and it stores it as a .dat file rather than text. I know this has to be with how I am setting up the table or the DB but I have gone through things and I think I am just skipping over something. * Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 * MySQL client version: 5.1.37 * PHP extension: mysqli that is the phpmyadmin info.

    Read the article

  • PHP Localhost Application connect to server database

    - by Cross Vander
    I want to ask about how to connect my localhost application (C:xampp/htdocs/myproject) to database at my server host (www.someweb.somedomain)? Am I possible to do that? If it is, how to connect it at my php config? Right now my config (server.php) is: <?php $host = "my web IP public:3306"; $user = "root"; $pass = ""; $db = "dispatcherDB"; $conn = mysql_connect($host, $user, $pass) or die ("Cant connect to mySQL"); mysql_select_db($db); ?> what I got: Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\XMS\server.php on line 7 So, what must I filled for $host? I'm trying using website IP, it still can't connect. Maybe there's someone here have experience at this problem? Sorry for my bad English

    Read the article

  • Empty database output in CI

    - by den-javamaniac
    Hi. I'm building a simple app and trying to test DB result output. But unfortunately all I'm getting is an array of size 0. Here's the controller code excerpt: $data['query'] = $this->db->query('SELECT role_id, role_privilege FROM role'); $this->load->view('welcome_message', $data); And a view code excerpt: <?php echo count($query->result_array())."<br/>"; foreach ($query->result() as $row){ echo $row->role_id . '<br/>'; echo $row->role_privilege . '<br/>'; } echo 'Total result '.$query->num_rows(); ?> And what I get is next: 0 Total result Running query from a command line gives a 2 rowed output. Can someone point out what i'm missing?

    Read the article

  • Are there any good Javascript/Jquery thumbnail script equivalents to TimThimb (PHP)?

    - by Mark
    For those unaware of TimThumb, it will take any image, of any size or dimension and create a thumbnail on the fly to any desired size. The beauty of it is that it really works on any dimension you feed it through a combination of either resizing the image, cropping or zoom cropping the image. Ive been searching for jscript equvalents but they either require the user to actually mask out the thumbs manually (looking for a script that automatically does it to images) or the scripts can't handle images in a different aspect ratio. Thanks for any leads on this!

    Read the article

  • How to create wordpress-like option table and get values for each row? (PHP-MySQL)

    - by Nacho
    Hi guys. I'm looking to create an options table in my db that makes every record a system option, so i can work with a little number of fields. my db has the following structure: 3 columns named id, name, and value following data is inserted as an example -- id - name - value 1 - uri - www.example.com 2 - sitename - Working it out 3 - base_folder - /folder1/folder2/ 4 - slogan - Just a slogan for the site -- that way i can include a large number of customizable system options very easily the problem is that i don't know how to retrieve them how do i get the value of uri and store it as a var? and better yet, how do i get, for exmaple, values of id 1 and 4 only without making a query each time? (i assume multiple queries are useless and a pretty ugly method) i know the question is pretty basic but i'm lost here. i'd really appreciate your answer! Thanks in advance

    Read the article

  • Object changed while deserialization

    - by neoms21
    I'm serializing an object and storing the serialized value in db and getting the deserialization to work fine as well after getting values from db. But problem occurs if the existing object is modified and a new property is added in the class. Then while deserializing it looks for that property in serialized text and upon not finding it there, I get the following error System.Runtime.Serialization.SerializationException: Member 'temp' was not found. Is there any way I can know if new property was not there while serialization and can skip that? I'm using custom serialization.

    Read the article

  • Configuring jdbc-pool (tomcat 7)

    - by john
    i'm having some problems with tomcat 7 for configuring jdbc-pool : i`ve tried to follow this example: http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency so i have: conf/server.xml <GlobalNamingResources> <Resource type="javax.sql.DataSource" name="jdbc/DB" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" username="user" password="password" /> </GlobalNamingResources> conf/context.xml <Context> <ResourceLink type="javax.sql.DataSource" name="jdbc/LocalDB" global="jdbc/DB" /> <Context> and when i try to do this: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource datasource = (DataSource)envContext.lookup("jdbc/LocalDB"); Connection con = datasource.getConnection(); i keep getting this error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:803) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) pls help tnx

    Read the article

  • Linq to SQL DateTime values are local (Kind=Unspecified) - How do I make it UTC?

    - by ericsson007
    Isn't there a (simple) way to tell Linq To SQL classes that a particular DateTime property should be considered as UTC (i.e. having the Kind property of the DateTime type to be Utc by default), or is there a 'clean' workaround? The time zone on my app-server is not the same as the SQL 2005 Server (cannot change any), and none is UTC. When I persist a property of type DateTime to the dB I use the UTC value (so the value in the db column is UTC), but when I read the values back (using Linq To SQL) I get the .Kind property of the DateTime value to be 'Unspecified'. The problem is that when I 'convert' it to UTC it is 4 hours off. This also means that when it is serialized it it ends up on the client side with a 4 hour wrong offset (since it is serialized using the UTC).

    Read the article

  • C#.Net window application EXE and SQL SERVER 2000 Database at Client Machine

    - by user1397931
    Friends I have install a .net window application exe at client machine and its database in sql server 2000. For Exe I install .net framework and other support software and for DB i install sql server 2000 and Create Database over there and connect it. Working Properly But now client change Xp to window7. I search for installation of SQL Server 2000 , but its not working over there. So what i did, i send the MDF file of database with exe application and make connection string and its also working. Now i change something in DB , and trying to update .mdf file but its not reflecting the new one mdf its getting the old one. i am Stuck...... am i did any wrong ? because its difficult for me to fix. OR i want to know what is the efficient way of use of SQL Server 2000 database on window7 or any else solution is there? Please help me...

    Read the article

  • Won't connect to the database

    - by user1657958
    I'm confused...I'm using the same code in a different document and in there it's not a problem to get a connection to the database. But in the new document it's just not working...(password, username, database name...all is checked and correct) :-/ <?php define ("DB_HOST", "db1234567.db.hello.com"); // set database host define ("DB_USER", "db1234567"); // set database user define ("DB_PASS","password123"); // set database password define ("DB_NAME","db1234567"); // set database name $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection."); $db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database"); ?> In the browser I get this: "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'db1234567'@'123.123.12.12 (using password: YES) in /homepages/12/1234567/test/test.php on line 8 Couldn't make connection." Would be cool if someone could help me :) I'm not seeing any error... Thx!

    Read the article

  • Codeigniter Active record help

    - by sea_1987
    Hello, I am trying to increment a INT column by 1 if a certain field is not null on an update request, currently I have this update too columns, public function updateCronDetails($transaction_reference, $flag, $log) { $data = array ( 'flag' => $flag, 'log' => "$log" ); $this->db->where('transaction_reference', $transaction_reference); $this->db->update('sy_cron', $data); } What I need to know is how I can check if the value being sent to the log field is NULL and if it is how could I increment a column called count by 1?

    Read the article

  • Android-SQLite: How to Count specific value from Column?

    - by sanpatil
    I have two table (TABLE_EXAM,TABLE_RESULT). Here is value of my TABLE_RESULT. result_id exam_id question_id correct_answer 1 2 4 y 2 2 5 y 3 2 6 n 4 2 7 y I need to count how many correct_answer='y' where exam_id=2. I try following code but it return 0. public int calculateResult(int examId,String confirmAnswer) { int correctAnswer=0; try { SQLiteDatabase db=this.getWritableDatabase(); String selectQuery=("select count(correctAnswer) from result where exam_id ='" + examId + "' and correctAnswer ='" + 'y' +"'" ); // String selectQuery=("SELECT COUNT(*)FROM result WHERE exam_id ='" + examId + "' and correctAnswer ='" + confirmAnswer +"'" ); Cursor cursor = db.rawQuery(selectQuery, null); if(cursor.moveToLast()) { correctAnswer=cursor.getInt(3); } } catch(Exception e) { e.printStackTrace(); } return correctAnswer; } In variable confirm_answer i pass "y". Give me some hint or reference. Any help is appreciated. Thanks in Advance

    Read the article

  • Correcting an UPDATE statement (and making it more secure!)

    - by Jess
    I'm trying to a single value in my DB...When I run it through the console, it works correctly (as I'm replacing the variables with numbers and text).. However, My query is not running correctly. It's just prompting a syntax error Here is what I have: "UPDATE books SET readstatus='".$readstatus."' WHERE book_id=".$book_id; This won't work, I also tried doing something like this as I'm told this makes it a bit more secure? : "UPDATE books SET readstatus='{$readstatus}', WHERE read_id='{read_id}'"; This does not prompt any errors, but no change is happeneing to the value in the DB, I'm guessing the syntax is incorrect.

    Read the article

  • How do I create a sqlite 3 (.sl3) database file?

    - by BC
    I have a *.sqlite file... but I need the database in *.sl3 format? What software/tool can I us to create that? What are the steps? This is to be used in an iPhone app. Original developer used an .sl3 file, now that I have updated the DB - I can't seem to export/generate a .sl3 file I have tried just changing the extension - all the way to inserting the *.sqlite file in XCode and pointing the app delegates to the new DB file format... doesn't work. Thanks in advance...

    Read the article

  • Codeigniter: how do I select count when `$query->num_rows()` doesn't work for me?

    - by mOrloff
    I have a query which is returning a sum, so naturally it returns one row. I need to count the number of records in the DB which made that sum. Here's a sample of the type of query I am talking about (MySQL): SELECT i.id, i.vendor_quote_id, i.product_id_requested, SUM(i.quantity_on_hand) AS qty, COUNT(i.quantity_on_hand) AS count FROM vendor_quote_item AS i JOIN vendor_quote_container AS c ON i.vendor_quote_id = c.id LEFT JOIN company_types ON company_types.company_id = c.company_id WHERE company_types.company_type = 'f' AND i.product_id_requested = 12345678 I have found and am now using the select_min(), select_max(), and select_sum() functions, but my COUNT() is still hard-coded in. The main problem is that I am having to specify the table name in a tightly coupled manner with something like $this->$db->select( 'COUNT(myDbPrefix_vendor_quote_item.quantity_on_hand) AS count' ) which kills portability and makes switching environments a PIA. How can/should I get my the count values I am after with CI in an uncoupled way??

    Read the article

  • problem with Expression not equal types

    - by user428547
    class first { private int? firstID; } class second { private int secondID; private int secondField; } public override Expression<Func<first, bool>> FirstFilter() { Contex db = new Contex(); List<second> list = (from p in db.second select p).ToList(); return b => list.Select(p => p.secondID).Contains(b.firstID); } and i have error: cannot convert from 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.IEnumerable' i have tried many diferent ways, but i just don't know how can i fix it.

    Read the article

  • Why delete and recreate a querydef object when you can just change the .SQL property?

    - by dblE
    Do you remember the venerable old Microsoft Query by Form (QBF) VBA example from back in the day link that recommended that you delete an existing query and then recreate it dynamically?: On Error Resume Next db.QueryDefs.Delete ("qryResults") On Error GoTo 0 Set qdf = db.CreateQueryDef("qryResults", "SELECT p.*... Why not just change the SQL property of the querydef object? qdf.SQL = "SELECT p.*... I am wondering if anyone knows why the MS engineers wrote an example that suggests that you delete and then recreate a query instead of simply changing the SQL property? I would guess that the act of deleting and recreating objects over time could contribute to corruption and bloating in your front end, not to mention changing the SQL property is so much simpler. Does anyone have more insight into this?

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >