Search found 74 matches

by tranquillo
Mon Dec 20, 2004 1:43 pm
Forum: mySQL & php coding
Topic: How to get a second maximum value?
Replies: 3
Views: 948

I know this post is over a month old, but anyways...

if you use MySQL 4.1:
SELECT MAX(id) FROM table WHERE id<(SELECT MAX(id) FROM table);

or something like that...
by tranquillo
Mon Dec 20, 2004 1:29 pm
Forum: mySQL & php coding
Topic: PHP/MySql Tables and Variables - I Think....
Replies: 0
Views: 638

the first problem (display x number of input fields) is probably solved best with javascript... use the <input style="visibility:hidden;" ... > and document.form.element.style.visibility='visible' I'm not sure about cross browser compability, but just google around for a bit and you'll find out... t...
by tranquillo
Mon Nov 29, 2004 1:09 pm
Forum: mySQL & php coding
Topic: ordering non-fulltext serch result by relevance
Replies: 2
Views: 1181

order by what?

is it possible to use AS in the WHERE statement somehow?
none of the fields in any table is of any use when it comes to relevance...

what I need is for the red-marked statements to be ranked higher than the other where statements...
by tranquillo
Mon Nov 29, 2004 3:22 am
Forum: mySQL & php coding
Topic: ordering non-fulltext serch result by relevance
Replies: 2
Views: 1181

ordering non-fulltext serch result by relevance

hi... Does anyone know how to order a search result by relevance without using FULLTEXT? this is my sql: SELECT * FROM Customer RIGHT JOIN CustomerTypeOne ON Customer.cId=CustomerTypeOne.cId RIGHT JOIN TypeOneProduct ON CustomerTypeOne.cOneId=TypeOneProduct.cOneId WHERE Customer.CustomerType='Produc...
by tranquillo
Tue Nov 23, 2004 2:05 pm
Forum: PHP coding => General
Topic: file upload error
Replies: 2
Views: 751

file upload error

Warning: move_uploaded_file(Bilder/Konstnarer/00089/00089.jpg) [function.move-uploaded-file]: failed to create stream: No such file or directory in h:\home\...server crap....\public_html\temp\admin\konstnarer.php on line 577 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to mov...
by tranquillo
Sun Nov 21, 2004 3:27 am
Forum: PHP coding => General
Topic: check if there's a file
Replies: 4
Views: 1169

ah... thanks!
then I guess I don't have to use error_reporting(0); to get rid of the errors ;)

-s
by tranquillo
Sat Nov 20, 2004 2:23 pm
Forum: PHP coding => General
Topic: check if there's a file
Replies: 4
Views: 1169

eh, nevermind...

if(file(pictures/93489348.jpg))

it really was that simple... ;) I love php...
by tranquillo
Sat Nov 20, 2004 2:18 pm
Forum: PHP coding => General
Topic: check if there's a file
Replies: 4
Views: 1169

check if there's a file

Hi guys...

is it possible to check if a specific file exists?

like this:

if(some_check_function("pictures/93827484.jpg"))
echo "<img src='".$thepicture."'>";
else
echo "<img src='pictures/nopic.jpg'>";
by tranquillo
Sun Oct 31, 2004 1:47 am
Forum: mySQL & php coding
Topic: Querying two tables
Replies: 2
Views: 1104

films(pk:film_id, title, director, yearofproduction, etc...) actors(pk:actor_id, name, age, sex, etc...) actorsinfilm(fk:film_id,fk:actor_id) this way the "actorsinfilm" connects the two tables and there are no limitations to how many or few actors thera are in a film. SQL: SELECT films.title, actor...
by tranquillo
Mon Oct 25, 2004 6:19 am
Forum: PHP General
Topic: format numbers
Replies: 6
Views: 1732

hehe... jag menade postnummer, inte riktnummer.. så det swirlee skrev funkar nog...

swirlees thing will probably work... thanks...
by tranquillo
Sat Oct 23, 2004 6:49 am
Forum: PHP General
Topic: format numbers
Replies: 6
Views: 1732

yea, I know, but I loose some of the functionality if I do...
by tranquillo
Sat Oct 23, 2004 5:17 am
Forum: PHP General
Topic: format numbers
Replies: 6
Views: 1732

format numbers

Hi guys... I've got a small problem... area codes in sweden are usualy printed "352 37" but since I use a mysql database and store the area codes as integers they're in this format "35237"... I want to print the area codes in the right format... I've looked up the number_format() function on php.net...
by tranquillo
Thu Jul 15, 2004 3:19 pm
Forum: mySQL & php coding
Topic: non-php related mysql question
Replies: 2
Views: 715

non-php related mysql question

Hi.

I've got a bunch of e-mail adresses and phone numbers and stuff in a mysql database and I wanna know if there's an easy way of converting this to suite MSoutlook.
does any one know?

thanks.
by tranquillo
Thu Jul 15, 2004 3:02 pm
Forum: mySQL & php coding
Topic: troubleshooting for-loop
Replies: 1
Views: 606

troubleshooting for-loop

Hi guys... what's wrong with this code: $listan = mysql_query("SELECT namn FROM Konstklubb ORDER BY medlemmar desc",$db); $klubbNamn = mysql_fetch_array($listan); if ($klubbNamn) { for($i = 0; $i <= 9; $i++) { echo '<span class="content">...
by tranquillo
Wed Apr 21, 2004 9:51 am
Forum: PHP coding => Mail
Topic: not the right "From" adress
Replies: 6
Views: 2827

Hi again guys... now I'm confused... This is something that really buggs me when programming in any language: prolems that fix themselves and I don't have a clue why. All I really did was add the error report thing... no errors were reported and the email looks just the way I want it. anyways, thank...
by tranquillo
Mon Apr 12, 2004 10:13 am
Forum: PHP coding => Mail
Topic: sending html file
Replies: 6
Views: 3711

could you show us the code?
by tranquillo
Sun Apr 11, 2004 11:08 am
Forum: PHP coding => Mail
Topic: not the right "From" adress
Replies: 6
Views: 2827

Hi again... I've been fooling around with the headers some more and got the d***** mail to use the right reply adress... $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html;"; $headers .= "From: ".$myemail."\r\n"; $headers .= "Reply-To: ".$myemail."\r\n"; what buggs me now is th...
by tranquillo
Sun Apr 11, 2004 8:14 am
Forum: PHP coding => Mail
Topic: not the right "From" adress
Replies: 6
Views: 2827

thanks guys... it reduced the problem a litle bit...
I removed the "." and now the headers don't show in the message, but the replyadress is still not right... when I press reply, the adress is "mydomain.whatever@theWebHotelServer.whatever".
by tranquillo
Fri Apr 09, 2004 2:05 pm
Forum: PHP coding => Mail
Topic: not the right "From" adress
Replies: 6
Views: 2827

not the right "From" adress

hi... I'm trying to get a php mail script working, but it's nog going to good.... I looked around here for some sample code and foud a link to some site, don't remember wich, where I found some... I've changed it a bit, but it doesn't work... there were more "headers" first, but everyting in the hea...
by tranquillo
Wed Apr 07, 2004 5:36 am
Forum: PHP coding => Mail
Topic: More than just mail
Replies: 2
Views: 2321

I'm quite a biginner at php to, but I'm guessing that this is what you wanna do... put the form in a html page with action="next.php" then put something like this in the next.php page: //get the form data into variables $PersonNr = $_POST["PersonNr"]; $Fnamn = $_POST["Fnamn"]; $E...
by tranquillo
Wed Oct 22, 2003 3:01 pm
Forum: PHP General
Topic: php/MySQL vs. Asp.net/MsSQL
Replies: 2
Views: 882

php/MySQL vs. Asp.net/MsSQL

Hi... I'm in the begining of a project and I'm having some discussions about what language we're going to use for a web portal. the advantages I've heard for asp.net is something about that it "pre compiles" the code (?) to make it quicker... don't know if that's the right english word for it... but...
by tranquillo
Mon Oct 20, 2003 4:18 am
Forum: PHP & MySQL Security
Topic: Form submition
Replies: 5
Views: 3384

wouldn't it be better to use

Code: Select all

if($_SERVER['HTTP_REFERER'] != "http://yourdomain.com/lastpage.php")


if you use only 'lastpage.php',couldn't someone name their document 'lastpage.php' and be able to submit data anyway?
by tranquillo
Sun Oct 19, 2003 7:34 am
Forum: mySQL & php coding
Topic: random problem
Replies: 2
Views: 803

thanks... I was looking at that post before, but I just didn't think it was that easy...
by tranquillo
Sun Oct 19, 2003 4:08 am
Forum: mySQL & php coding
Topic: random problem
Replies: 2
Views: 803

random problem

I've got a problem... I'm trying to get a random resuld from a table, thought this would be easy but I haven't been programming in php for a couple of months and I guess I'm getting a bit rusty... $sql="SELECT ID FROM citat"; $result=mysql_query($sql,$db); do { $rowsTotal = my...
by tranquillo
Sat Oct 18, 2003 3:02 am
Forum: mySQL & php coding
Topic: MySQL vs. Access.
Replies: 2
Views: 835

MySQL vs. Access.

Hi guys...

could anyone tell me exactly what makes MySQL better than Access? Because I'm guessing it is... for bigger projects anyways... right?
And I don't want any of those religous anwers where MySQL is better just because... or Access sux because it's Microsoft...


thanx..