Re: [PHP-DB] Accessing my variables
My problem is: I have an include file: global.inc.php Inside that file I have: $myVariable = xankjndckjnskncd; now I have a index.php that has: ? Include('global.inc.php); Print $myVariable; ? Anyone got a clue on this one? Depends on what your problem is, not really a clear problem description here ;) and it has to be include (global.inc.php); instead of include ('global.inc.php); laters, Fedde ~= The sum of the intelligence on the planet is a constant; the population is growing. =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Question
Heyaz, You've got some unclosed statements. Try using tabs for each statement to make it easier on yourself like: if ($iusetabs == true){ echo like this ; } And in your code.. things go wrong here: == echo /table; echo input type='submit' value='See how you did' name='submit'; echo /form; } elseif ($submit) { { $score = 0; $total = mysql_num_rows($result); good luck to you laters, Fedde ~= The sum of the intelligence on the planet is a constant; the population is growing. =~
Re: [PHP-DB] SMTP authentication
I want to ask you, how I must setup my PHP.INI file, to send e-mail from my Web Site if my SMTP server requires authentication. Otherwise, I want to know if exits some kind of public SMTP sever that I could use. I think you don't need to adjust your php.ini for that, just use the right params for sending the mails. Isn't somthing like this is what you need? (got it from: http://nl3.php.net/mail) Or did i get your question wrong? ? include(Mail.php); $recipients = [EMAIL PROTECTED]; $headers[From]= [EMAIL PROTECTED]; $headers[To] = [EMAIL PROTECTED]; $headers[Subject] = Test message; $body = TEST MESSAGE!!!; $params[host] = smtp.server; $params[port] = 25; $params[auth] = true; $params[username] = user; $params[password] = password; // Create the mail object using the Mail::factory method $mail_object = Mail::factory(smtp, $params); $mail_object-send($recipients, $headers, $body); ? laters, Fedde ~= The sum of the intelligence on the planet is a constant; the population is growing. =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How to do freeform text search across multiple fields ??
What I wanna do is make it possible to search for partial content in model,variant, and type fields, all 3 at the same time, or each individually as the user wants...case insentive too ... ? //assuming you got a POST from the form :) reset ($_POST); while (list ($key, $val) = each ($_POST)) { $$key = $val; } if(!(empty($model))) { $searchstring .= AND model LIKE '$model'; } if(!(empty($variant))) { $searchstring .= AND variant LIKE '$variant'; } if(!(empty($fields))) { $searchstring .= AND fields LIKE '$fields'; } $query = SELECT * FROM cpu WHERE cpuID '0' $searchstring ORDER BY cpuID; $connection = mysql_connect($HOST, $USERNAME, $PASSWORD); $SelectedDB = mysql_select_db($DBNAME); $result = mysql_query($query); //etc. ? It's a bit quick and dirty, because you need something like the cpuID '0' to make this to work. But its a start right ;) laters, Fedde ~= The sum of the intelligence on the planet is a constant; the population is growing. =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] viewing search result
str_replace(' ','%',$searchwords); $query=select * from table where colom like '%$searchwords%' order by id desc ; $result=mysql_query($query); $numresult=mysql_num_rows($result); Use limit in your select statement. laters, Fedde ~=There's a fine line between genius and insanity. I have erased this line=~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Skipping a row
I have a select statement that goes to my mySQL db and selects some data from there. I thought it was working great BUT it is skipping the first row. Any ideas? I know it has to be somehting simple I am missing. What is the SQL statement you're currently using? Fedde ~=There's a fine line between genius and insanity. I have erased this line=~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] pathinformation from file-field
how can I get the pathinformation you can see in the file-field if you chose one file within a formular for transfer. http://nl.php.net/manual/en/function.pathinfo.php ? laters, Fedde ~= Everybody lies, but it doesn't matter because nobody listens =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MYSQL Query problem...
is there something wrong with my SQL Query? I didnt get any results neither errors.. ?php $link = mysql_connect('localhost', 'username') or die('Cannot connect to the database.'); mysql_select_db(profiles,$link); $SQLQuery = INSERT INTO profyles (username, fname, mname, lname, address, country, gender, sexuality, status, bday, race, yahoo, msn, icq, email, webpage, hair, bodytype, eye, height, weight, facialhair, hobbies, interests, aboutme, profession, food, music, tvshows, authors, movies, rolemodel, place, visit, online, picture) VALUES ('$user', '$firstname', '$middlename', '$lastname ', '$address, '$country', '$gender', '$sexuality', '$status', '$birthday', '$race', '$yahoo', '$msn', '$icq', '$email'. '$webpage', 'haircolour', '$bodytype', '$eyecolour', '$height', '$weight', '$facialhair', '$hobbies', '$interest', '$aboutme', '$profession', '$food', '$music', '$tvshows', '$authors', '$movies', '$rolemodel', '$place', 0, 'y' , 'y'); mysql_query($SQLQuery,$link); ? '$email'. '$webpage' -- shouldn't this be:'$email', (comma ;))'$webpage' laters, Fedde ~= Everybody lies, but it doesn't matter because nobody listens =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unique user ID?
Ow, but is there not a way to recognize a user the next time he logs in? Ehm, you could use the user's ip address, and hope it isn't a dynamic one. Or you'll just have to use a cookie. Cheers, Fedde van Feggelen ~= Even a broken clock is right at least twice a day =~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php