RE: [PHP-DB] transaction locking
Hi ALek, Yes you can make the column auto_increment. YOu can also make the incrementations start at a particular value by using the ALTER command. EG: ALTER TABLE mytable AUTO_INCREMENT = 99; it will start your next inserted record with 99 for that specific column value. I am not 100% sure about the values that you already have in your field. I assume that they are all unique and that you want to start the increment from the last value +1. anyway hope this helps. Angelo Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HELP!
your post is abit vague, give more details or code then we can try help. Its kinda like you saying, help my car wont go. -Original Message- From: Akmal [mailto:[EMAIL PROTECTED] Sent: Saturday, December 06, 2003 5:43 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] HELP! I'm trying to create a guestbook and... I'm having trouble getting a certain amount of entries per page. Please help, a snippet of a code would be nice. Thanks! -Akmal- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] help newbie
Hi , please help this newbie , how to make my database view from [1] [2] [3] [4] [5] [6] [7] [8] to 1 2 34 Thanks very much Hadi require(cobaconfig.php); $numresult = mysql_query(select * from dataiklanbaris order by id desc); $jumlah = mysql_num_rows($numresult); $limit = 20; if (empty($offset)) { $offset = 0; } $query = select * from dataiklanbaris order by id desc limit $offset, $limit; //pembagian halaman dimulai $result = mysql_query($query); $halaman = intval($jumlah/$limit); if ($jumlah%$limit) { $halaman++; } for ($i = 1; $i=$halaman; $i++) { $newoffset=$limit*($i-1); if ($offset != $newoffset) { echo [a href=\lihatiklan.php?offset=$newoffset\$i/a]; } else { echo [$i]; } } //pembagian halaman selesai while ($row = mysql_fetch_array($result)) { echo ( tr td width=\330px\font size =\3\$row[isiiklan]br/td td width=\50px\p align =\center\font size =\2\$row[lt]br/td td width=\50px\p align =\center\font size =\2\$row[lb]br/td td width=\70px\p align =\center\font size =\2\$row[harga]br/td td width=\100px\p align =\center\font size =\2\$row[kecamatan]br/td td width=\100px\p align =\center\font size =\2\$row[kota]br/td td width=\100px\a href=\detail.php?id=$row[id]\ target=\blank\p align =\center\font size =\2\$row[gambar]br/a/td /tr ); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Web counter question..
Try : ? session_start(); if ( ! isset($_SESSION['count']) ) { $fp=fopen(./counter.txt,r); $_SESSION['count']=fread($fp,5); fclose($fp); $_SESSION['count']++; $cnt=$_SESSION['count']; $fp=fopen(./counter.txt,w); fwrite($fp,$cnt); fclose($fp); } $c= $_SESSION['count']; print You are visitor no : b$c/bBR; ? Jochem James Hatridge wrote: Hi all.. I just put up my stamp bulletin on line (issue #100!!). I have a problem with it. The counter that I use counts everyone every time they look at the site. I want a better counter, can you all suggest one? It's got to work with html and php only. Thanks, JIM PS Check out my stamp bulletin, link below! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help newbie
Hadi wrote: Hi , please help this newbie , how to make my database view from [1] [2] [3] [4] [5] [6] [7] [8] to 1 2 34 Thanks very much Hadi ***removed code*** You could convert the array into a string but why would you like to do that? Not a good way but a possible way is $varString = $array[index] . . $array[nextindex] ... ofcouse it would be better with an foreach but still arrays string imho -- Tim Nilimaa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help newbie
Return Receipt Your Re: [PHP-DB] help newbie document : was Roy A Jones/IT/GSK received by: at: 12/08/2003 10:45:11 AM -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] graphics question
I am working on a Fedora-installed (linux) server with PHP 4.3.3 configured with ('./configure' '--enable-pic' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-jpeg-dir=/usr' '--with-png' '--enable-magic-quotes') plus a lot more that I stripped out for the sake of space. My problem is that when I use some sample code from a book that I am using to try to learn from (PHP and MySQL Web Development - Luke Wellington and Laura Thomson) some of the functions do not seem to work as they relate to graphics. I am using Homesite 5.0 and when a function is typed in to the editor it's appearance is different from regular text - this is not so with functions like ImageJpeg(); or imagecreatefromjpeg();. When I try to run either of these functions they do nothing and my error output says something like this: ( imagecreatefromjpeg(./test.jpg) [a href='/phpmanual/function.imagecreatefromjpeg.html'function.imagecreatefromjpeg.html/a]: failed to open stream: No such file or directory in /var/www/html/test.php on line 11). Can someone help me figure this out? thanks, DF -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql + php
hi! (B (BI am first question of php in this news group. I would like to ask my (Bquestion about (Bphp + mysql. Now I am programming php+mysql. I put word, excel, mpeg and (Bany binaries into (Bthe mySQL database using php on linux server,But I can take out these binay (Bfrom mySQL database. I would like to see the files and save my pc from (Bserver. So how can I take out from (Bthese binaries? If you know it how to take out and show it, please teach (Band help me how!!. (BThe information table of mySQL is "objects." So here is the program below; (B (B// database information (Bcreate table objects (B b_col blob, (B name varchar(30), (B file_size varchar(30), (B file_date datetime (B} (B// it works from "insert" SQL abc.php (B$db = mysql_connect("*", "***", ""); (Bmysql_select_db("***",$db); (B$sql_insert = "INSERT INTO objects(b_col, file_name, file_size, (Bfile_type,file_date) VALUES (B('$UploadedFile','$UploadedFile_name','$UploadedFile_size','$UploadedFile_type',now())"; (B (B mysql_query($sql_insert); (B (B// (B// But it does not work at. I can not see anything in my browser (B$sql_select = "select b_col, file_name, file_size, file_type, file_date (Bfrom objects where file_name like 'gball.gif'"; (B if(!($result=mysql_query($sql_select,$db))){ (B die; (B } (B (B $file_name = mysql_result ($result,0,"file_name"); (B echo $file_name; (B (B (B (BRegards, (Bjames (B (B_ $BM'C#$H(B24$B;~4V%[%C%H%i%$%s!V(BMSN $B%a%C%;%s%8%c!http://messenger.msn.co.jp (B (B-- (BPHP Database Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysql + php
James, (B (BThe consensus of developers here seems to have been not to store binary objects in the (Bdatabase. Rather store them in the file system and simply store reference records in (Bthe database. It is much easier this way. If doing it differently is not an option (Bfor you hopefully someone else on the list has done this. Unfortunately, I'm pretty (Bsure most of us haven't even tried since it is so much simpler to store them in the (Bfile system. (B (BHope this is helpful. (B (B Ryan (B (B-Original Message- (BFrom: Will Contact [mailto:[EMAIL PROTECTED] (BSent: Monday, December 08, 2003 1:10 PM (BTo: [EMAIL PROTECTED] (BSubject: [PHP-DB] mysql + php (B (Bhi! (B (BI am first question of php in this news group. I would like to ask my question about (Bphp + mysql. Now I am programming php+mysql. I put word, excel, mpeg and any (Bbinaries into the mySQL database using php on linux server,But I can take out these (Bbinay from mySQL database. I would like to see the files and save my pc from server. (BSo how can I take out from these binaries? If you know it how to take out and show it, (Bplease teach and help me how!!. (BThe information table of mySQL is "objects." So here is the program below; (B (B// database information (Bcreate table objects (B b_col blob, (B name varchar(30), (B file_size varchar(30), (B file_date datetime (B} (B// it works from "insert" SQL abc.php (B$db = mysql_connect("*", "***", ""); (Bmysql_select_db("***",$db); (B$sql_insert = "INSERT INTO objects(b_col, file_name, file_size, (Bfile_type,file_date) VALUES (B('$UploadedFile','$UploadedFile_name','$UploadedFile_size','$UploadedFile_type',now())"; (B (B mysql_query($sql_insert); (B (B// (B// But it does not work at. I can not see anything in my browser (B$sql_select = "select b_col, file_name, file_size, file_type, file_date from (Bobjects where file_name like 'gball.gif'"; (Bif(!($result=mysql_query($sql_select,$db))){ (Bdie; (B} (B (B $file_name = mysql_result ($result,0,"file_name"); (B echo $file_name; (B (B (B (BRegards, (Bjames (B (B_ $BM'C#$H(J24$B;~4V%[%C%H%i%$%s!V(JMSN $B%a%C%;%s%8%c!http://messenger.msn.co.jp (B (B-- (BPHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: (Bhttp://www.php.net/unsub.php (B (B-- (BPHP Database Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql + php
From: "Will Contact" [EMAIL PROTECTED] (B (B Now I am programming php+mysql. I put word, excel, mpeg and (B any binaries into (B the mySQL database using php on linux server,But I can take out these (Bbinay (B from mySQL database. I would like to see the files and save my pc from (B server. So how can I take out from (B these binaries? (B[snip] (B $sql_insert = "INSERT INTO objects(b_col, file_name, file_size, (B file_type,file_date) VALUES (B (B('$UploadedFile','$UploadedFile_name','$UploadedFile_size','$UploadedFile_ty (Bpe',now())"; (B (Bmysql_query($sql_insert); (B (BAre you sure anything is even being put in the database here? There's no (Berror checking. Is the blob empty? (B (B // But it does not work at. I can not see anything in my browser (B $sql_select = "select b_col, file_name, file_size, file_type, (Bfile_date (B from objects where file_name like 'gball.gif'"; (B if(!($result=mysql_query($sql_select,$db))){ (B die; (B } (B (B$file_name = mysql_result ($result,0,"file_name"); (Becho $file_name; (B (BYou need to check what's actually in your database. If you don't get a (Bresult here, then there's nothing matching "gball.gif" in your database (B(even if you think there is). (B (BAs for displaying these files again (obligatory mention that storing binary (Bfiles in the database is a BAD idea, IMHO) it's a simple matter of using (Bheader() to send an appropriate CONTENT header matching whatever kind of (Bfile you're sending "text/plain", "image/jpg", etc and then echoing the data (Bfrom the blob. (B (B---John Holmes... (B (B-- (BPHP Database Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Transfering large mysql database
Does anyone have a recomendation on an app that will help me transfer a large table from one host provider to another. I have tried phpmyadmin but if I export to SQL the import doesn't seem to work. If I export to csv I lose the column formating. On one host I have access to the root and on the other I am very limted. Thanks Harlan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Transfering large mysql database
Harlan Lax wrote: Does anyone have a recomendation on an app that will help me transfer a large table from one host provider to another. I have tried phpmyadmin but if I export to SQL the import doesn't seem to work. If I export to csv I lose the column formating. On one host I have access to the root and on the other I am very limted. Thanks Harlan What kind of error do you get when importing? Not sure how phpMyAdmin does it, but you can always use the mysqldump command (this is command-line, not PHP) to get a dump of any database or table. -- paperCrane Justin Patrin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Decent Search Engine (for MySQL)
Shall I resign myself to using a search with like %var%? Are there no other better methods? Maybe REGEXP has something to offer? -Original Message- From: Gavin Amm Sent: Thursday, 27 November 2003 4:00 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Decent Search Engine (for MySQL) Hi All, I'm after a tutorial, if you can point me to one I'd appreciate it. I want to create a search script that will look through tables/fields (that I specify) in a MySQL database. I don't want to use the MySQL full text searching (as I'm using an ISP database the default min word length is 3, we have a number of words that are 3 chars need them to be picked up in the search) I really hope there are better options than the LIKE command (These seem to be very popular from my searching). Regards, Gavin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Decent Search Engine (for MySQL)
Gavin Amm wrote: Shall I resign myself to using a search with like %var%? Are there no other better methods? Maybe REGEXP has something to offer? -Original Message- From: Gavin Amm Sent: Thursday, 27 November 2003 4:00 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Decent Search Engine (for MySQL) Hi All, I'm after a tutorial, if you can point me to one I'd appreciate it. I want to create a search script that will look through tables/fields (that I specify) in a MySQL database. I don't want to use the MySQL full text searching (as I'm using an ISP database the default min word length is 3, we have a number of words that are 3 chars need them to be picked up in the search) I really hope there are better options than the LIKE command (These seem to be very popular from my searching). Regards, Gavin Your best bet is probably http://www.mysql.com/doc/en/Regexp.html if you don't want to use LIKE. Other than that, you can get all of the data dn do the searching in PHP, but that's pretty much always going to be worse than a LIKE. -- paperCrane Justin Patrin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Transfering large mysql database
Hello, On 12/08/2003 10:08 PM, Harlan Lax wrote: Does anyone have a recomendation on an app that will help me transfer a large table from one host provider to another. I have tried phpmyadmin but if I export to SQL the import doesn't seem to work. If I export to csv I lose the column formating. On one host I have access to the root and on the other I am very limted. Here you may find several solutions to backup and restore whole MySQL databases or just single tables: http://www.phpclasses.org/backup -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php