217 Posted Topics
Re: Try this: [PHP] $query = "SELECT * FROM comments WHERE archive_id = '$archive_id'"; echo $query; exit(); $res = mysql_query($query); while ( $result = mysql_fetch_assoc($res) ) { $date = $result["date"]; $name = $result["name"]; $comments = $result["comments"]; echo "$date, $name, $comments"; }[/PHP] | |
Re: You have to have minimum three rows to get results with full text indexes. Really, you want more than that to get decent results. Thing is, MySQL tries to be smart and automatically ignores words that are in 50% or more of the rows. The idea is that if you … | |
Re: I have written 2 PHP classes that may be beneficial for your project, jime0726. For each, I have also written an article explaining how to use the code with plenty of examples. [b]PHP Database Class with Caching[/b] [url]http://www.tgreer.com/class_db_php.html[/url] This class provides a common interface to MySql, Postgres, and MSSql. HOWEVER, … | |
Re: Unfortunately, I do not know about the raw MySql files, so I can't answer that question. Hopefully another guru will reply with a solid answer about that. What I can offer you is to tell you that phpMyAdmin (You do have that right?!) has an export feature that can create … | |
Re: I'm quite confused both by what you say you want to do and by your code. Are you able to re-phrase this to make it clearer? For example, is the <SELECT> dropdown supposed to be [b]table [/b]names or [b]column [/b]names? How does the value of [b]$search[/b] get populated? | |
Re: I use Fedora Core, which is *almost* the same as Redhat. So maybe this will work for you, maybe not. I don't know how to use any of the GUI tools. At a shell prompt, as root type this: [CODE] service httpd start [/CODE] If Apache is already running, that … | |
Re: I just wrote a WAMP (Windows, Apache, MySql, PHP) HOWTO. It's at the bottom of this thread: [url="http://www.daniweb.com/techtalkforums/thread26579.html"]http://www.daniweb.com/techtalkforums/thread26579.html[/url] In that tutorial, you'll see how to modify which filenames Apache treats as "default" pages. But to directly answer you question, this line in your httpd.conf file defines the filenames (and order … | |
Re: Check out the top user comment listed on the PHP documentation page for mssql_get_last_message(). [url]http://www.php.net/manual/en/function.mssql-get-last-message.php[/url] It shows a possible way to get the full error message by querying it from SQL Server. | |
Re: [QUOTE=paradox814][php]$_SESSION['someVar'][$i] = $_POST['someVar'][$i][/php][/QUOTE] $_POST['someVar'][$i] is not valid unless your 'someVar' FORM element is an array of checkboxes or you have multiple text fields with the same name. Normally, it would just be $_POST['someVar']. Whether it is an array or not, you can just do this: [PHP] $_SESSION['someVar'] = $_POST['someVar']; [/PHP]It … | |
Re: I'm not sure why you titled your post htpasswd and htaccess when your question is about the basics of getting PHP configured with Apache on WinXP. Anywho..... I wrote a WAMP tutorial for WinXP Home/Pro. It can be found at [url="http://www.troywolf.com/articles/wamp_howto.htm"][b]http://www.troywolf.com/articles/wamp_howto.htm[/b][/url] If you don't mind starting over, just uninstall what … | |
Re: For your mysql error, test your SQL statement. Right after your line that builds your SQL statement, do this: [PHP] echo $sql; exit(); [/PHP] Examine the output to see if something is wrong with the SQL statement. Try running it directly against your database using phpMyAdmin or the command line … | |
Re: One important (to me) difference between Home and Pro is that Home does not allow you to Remote Desktop to it. | |
Re: What you describe sure sounds strange, and I wish I could see your site so I'd know what you are talking about, but the link you provided is not working. You said it works when user is logged in--that the problem occurs when user is NOT logged in. So, let's … | |
Re: There are two things you need to do to troubleshoot this problem. INSIDE your function, at the very top, do this: First, echo out one of the arrays like this: [PHP] echo "<pre>"; print_r($Date_Added); echo "</pre>"; [/PHP] Then echo out the value of $num: [PHP] echo "<hr />".$num; [/PHP] You … | |
Re: PHP's official tutorial for beginners is a good place to start. [url]http://us4.php.net/tut.php[/url] | |
Re: [QUOTE=stevoo]basicly i have a vbulletin forum and i am trying to create a simple web page , now the thing that i do not now is how can i obtain the current Members that are registered in the forum and show it in my web page[/QUOTE] The forum you are … | |
Re: I do not understand how it would not be looping $nrow times. Please add echo() statements after most every line to output debugging information. For example: [PHP] if (!$result) { echo "<br />ERROR! result is false."; } $nrow = mysql_num_rows($result); echo "<br />nrow: ".$nrow; if ($Vh4 == "VH4") { echo … | |
Re: Whoa, just beginning, eh? Well, you've got a ways to go, but try to enjoy the journey...and don't forget to sleep! :) The system you describe sounds similar to a forum/bulletin board system. The features restricting users to various access levels are common in applications such as phpBB and VBulletin … | |
Re: I wrote a system to do this a few years ago. You can look at what I did by going to [url]http://www.mvirony.com/[/url], then navigate to the [b]Boat Layout[/b] page. When you hit the home page, make sure you allow popups for the site. There aren't any ads or anything, but … | |
Re: The way to debug javascript is to make a copy of the full script, then remove everything but a few lines or functions. Test to see if it works. If not, remove more. Once you have a page that loads without any errors, add more code back in. Add a … | |
Re: First of all, it sounds like you don't have any graphical interface for MySql currently. Do you have phpMyAdmin? If not, GET IT! [url="http://www.phpmyadmin.net/home_page/"]http://www.phpmyadmin.net/home_page/[/url] phpMyAdmin is a PHP browser-based MySQL Administration tool. You can create databases, table, columns, edit current data, get lists of data, import, export, etc. It's really … | |
Re: Tip: Somebody will probably reply to help you on this, but your chances of getting a reply are MUCH higher if you will narrow your problem down to the one or 2 steps where the problem actually occurs, then post only enough code to demonstrate the problem. Many times, in … | |
Re: Oh, I remembered this post ([url]http://www.daniweb.com/techtalkforums/thread24929.html[/url]) where a product named [b]databik[/b] was mentioned. I've never used it, but it claims to do what you want. [url]http://www.dadabik.org/[/url] | |
Re: It sounds like you plan to have each joke be it's own PHP page? Joke #1: 0001.php Joke #2: 0002.php Joke #3: 0003.php ... That will work, but considering that each joke is only a small bit of text, and that you probably have a lot of other common stuff … | |
Re: Hey, symoore22! The problem is that session_start() has to write a cookie to the user's computer, and PHP can't write COOKIES after you start the output because once the HTTP headers are sent, cookies can't be sent. (They are sent in the headers.) So you just need to put session_start() … | |
Re: Check out PHP's [b]substr()[/b] function. [url]http://us4.php.net/manual/en/function.substr.php[/url] For example: [php] $zipcode = $_POST['zipcode']; $short_zip = substr($zipcode,0,2); [/php] | |
Re: Senexom asks a good question--what do you REALLY want to do? You could have code such as this: [PHP] <table> <tr> <td> <?php $page_action = $_GET['a']; switch($page_action) { case "action1": echo "You chose action 1."; break; case "action2": echo "You chose action 2."; break; default: echo "Welcome to my page."; … | |
Re: This is the PHP forum. Please post this in the DHTML/Javascript forum. Or Forum Moderator, please move this post. | |
Re: It appears that you have nothing that ties your tables together. I come to this assumption both from looking at your table structure and the query you posted. Anytime you have a SQL statement with more than one table, you must have something that ties the tables together. Without this, … | |
Re: [PHP] <?php $script_dt = date('Y-m-d'); //Modify formatting for your needs. ?> <input type="text" name="userdate" value="<?= $script_dt ?>" /> [/PHP] See [url]http://us2.php.net/manual/en/function.date.php[/url] for more about date formatting. | |
Re: I [i]think[/i] I understand the functionality you are looking for. If not, I apologize now. I've never seen anything like you described. This functionality is usually accomplished using what are commonly referred to as "Lookup Tables". A Lookup Table is usually a relatively small table with usually just 2 columns: … | |
Re: The user, of course, can delete their cookies anytime they want using the browser's tools. Web applications can only modify cookies on user computers that are within your same domain. So if your domain wrote the cookie, you can expire or change it. If the cookie is from somebody else's … | |
Re: Wenn Sie nur numerische Daten in der Spalte speichern, bilden Sie dann die Spalte Daten-Art (INT, BIGINT, DOUBLE). Wenn Sie dies tun, sortieren die Daten numerisch. Nur gesetzt in Ihre Formatierung (Kommas, usw..) nach Ihnen ziehen Sie die Daten die Datenbank heraus. Speichern Sie die Zahlen nicht in der Datenbank … | |
Re: I'm the author of those articles and the class. It is posted here on Daniweb, but the article version at [url]www.tgreer.com[/url] provides a lot more in-depth explanation of usage. sm00nie, check out PHP's stripos() function. It is what you are looking for I believe. [url]http://us2.php.net/manual/en/function.stripos.php[/url] | |
Re: Almost always a missing semicolon! Look at the line directly above the line you posted. | |
Re: Akoloff, if you want to use ASP as you mentioned, then look up ASP's Request Object. It comes in three forms that apply to your scenario: 1. Request.Querystring : to retrieve values from the HTTP GET. 2. Request.Form : to retrieve values from the HTTP POST. 3. Request : will … | |
Re: Please read and follow Paradox814's post at this thread: [url="thread25821.html"]http://www.daniweb.com/techtalkforums/thread25821.html[/url] It will show you some basics of running mysql queries in PHP along with how to read the mysql errors. Use the techniques shown to modify how you run your queries. Create a page that only has the problem--nothing else. … | |
Re: [QUOTE=thandermax]Dear all members, I have the following specifications: 1. Fedora core 3 2. Apache 2.0.54 3. PHP 5.0.4 4. MySQL[/QUOTE] Are these specs your local machine or the remote server? On the local machine, is the httpd (Apache) service started? Is the mysqld service started? Have you created a database? … | |
Re: Not sure why nobody replied to this earlier. I just saw it. Well, you will have data obviously. So you'll want a database. And you'll need a programming language, you already know that. You'll also need a webserver. You know that, too, of course. The architecture you use depends on … | |
Re: Sorry you did not get any replies, but please follow up to let us know what you learned. Help those who come after you. Thanks. | |
Re: [QUOTE=zippee]if the mov value is numeric, then the code should look like if ($mov = 1). if the value is integer, the if ($mov == "1")[/QUOTE] Actually, whether it's numeric or string, the same rules apply. A single equal sign will assign a value to a variable. A double equal … | |
Re: [QUOTE=michael123]I have a login script, I want to modify it to restrict the sharing username access, by IP address, what will be a good method to do this?[/QUOTE] What I think I hear you say is you want to be able to detect if more than one IP address logs … | |
Re: Please read and follow Paradox814's post at this thread: [url]http://www.daniweb.com/techtalkforums/thread25821.html[/url] It will show you some basics of running mysql queries in PHP along with how to read the mysql errors. Use the techniques shown to modify how you run your queries. Create a page that only has the problem--nothing else. … | |
Re: This may seem too obvious, but the problem is that $result is not a valid MySQL resource. So why is that? Since your other queries work, we have to assume your connection is good. So the almost sure candidate is your query. Something is wrong with your query. Try changing … | |
Re: Check out some of the scripts at [url]http://www.walterzorn.com/index.htm[/url]. Walter Zorn has one that covers Drag & Drop. | |
Re: I have not looked at that script, but you are saying that you can run rss2html.php and get the output that you want, but you want that output inside your own index page instead? You mention that your home page is already named index.php, so it's already a PHP script … | |
Re: If you want an app to allow complete page creation and site design from scratch, there are lots of great apps available. One of my favorites is WebEdit Pro from [url]www.interspire.com[/url]. It's relatively pricey, but very robust and professional. If instead, you have templates or simple sites that you create … | |
Re: Just use the auto number anyway. It doesn't matter if you delete thousands of records. Gaps in the number sequence are not a problem. It's still a unique id. | |
Re: I assume your only question is how to build your javascript line that defines the array, but instead of hard-coding the array items, you want them populated from a SQL query? If this is the case, then this is a server-side question. And that depends on the language you are … | |
Re: I'm not sure of your current skill level, so I'm making some assumptions based on what you said. Assuming that you know how to craft a SQL query to select data about a specific product (a specific product ID), and assuming you know how to use PHP to execute that … |
The End.