1,741 Posted Topics
Re: [quote] <?php if (level == "1") { include('page_1.php'); } else if (level == "2") { include('page_2.php'); } else if (level == "3") { include('page_3.php'); } ?> [/quote] Shouldn't level be $level ? | |
Re: first of all, what is shorting a table ? secondly, what are containers ? Sorry for my ignorance, I didn't understand your question. | |
Re: [code=php] $query = "select * from table where home_phone like '%516%' OR work_phone like '%516%' OR mobile_phone like '%516%'"; [/code] | |
Re: [quote]echo'<input name="tradeaid" type="hidden" id="tradeaid" value="<?=tradeaid?>">'; echo'<input name="mtitle" type="hidden" id="mtitle" value="<?=mtitle?>">'; echo'<input name="nmain" type="hidden" id="nmain" value="<?=nmain?>">'; [/quote] missing $ in the values. | |
Re: Heh.. maybe "c" and "d" are varchar fields and the rest are integer fields ? Simplest way to debug this problem is to print out the query and see what does it have at the runtime. Then execute it in phpmyadmin or mysql console. Doing so, you will know where … | |
Re: [quote] like this web site [url]http://www.aljazeera.net/NR/exeres/F...7EA9DAD30F.htm[/url] [/quote] aljazeera ! :icon_eek: Anyway, [url]http://www.quackit.com/html/codes/html_marquee_code.cfm[/url] might help ! | |
Re: Hmm.. Does it give any error ? print out the query and see whats being passed as values.. [quote] $name=$_POST['name']; //from the name form $q_id=$_GET['id']; [/quote] What method have you specified for the form ? POST or GET ? | |
Re: [quote][root@cayenne /home/kletsker/mysqldump]# mysql kletsker_kletskerk < localhost.sql ERROR 1064 (42000) at line 89499: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''[ quote="Barend":3v' at line 1[/quote] I think (and I am not sure) the … | |
Re: [QUOTE=OmniX;603933]I have a variable in a variable. I have done this before but it is not working this time. I have it in a for loop so my code is: [code=php] $abc1 = one; $abc2 = two; for($i = 0; $i < 2; $i++) { echo $$abc$i; } [/code] The … | |
Re: Print your query and execute it in mysql console/phpmyadmin.. Also show us the query .. | |
Re: When you submit the page, only those checkboxes which were checked will be submitted. So, you will have the count of checkboxes which are checked, you will have all the checkboxes which were checked. Build your query depending upon those values. | |
Re: If "LLL" and "LLNNNN" are the 'standard' format, then you can use strlen to check the string length. If string length is 3, then its usertype1. If its 6, the usertype is 2. Well, this is the simplest way. But if you want to thoroughly check, you can explode the … | |
Re: That's strange. Is there any change of version in php/apache ? I can't think of a reason why your script is acting weirdly ! | |
Re: Print the update query and see if it executes in phpmyadmin/mysql console. What do you get ? A result or an error ? You can also try [code=php] $result = mysql_query($query,$conn) or die (mysql_error()); This will also give the error message about why the query failed! | |
Re: [quote] $querySQL = "insert into people (d_Name, d_Birthday, d_Birthday) values ($Name, $Birthday, $Telephone)"; [/quote] Thats wrong. Wrap values in single quote. ie., [code=php] $querySQL = "insert into people (d_Name, d_Birthday, d_Birthday) values ('$Name', '$Birthday', '$Telephone')"; [/code] Cheers, Nav | |
| |
Re: Are you getting any error ? The only thing that might be wrong with the query is, not using ' ' while inserting a value to the varchar field. ie., [code=php] $query = "insert into table (col1,col2) values ('test', 'test2')"; [/code] | |
Re: Have you got it right already ? While inserting a record to a table, you follow this syntax. [code=php] $sql = "insert into table (column1,column2) values ('$value1','$value2')"; [/code] Its while updating, you use this syntax. [code=php] $sql = "update table set column1='$value1', column2='$value2' where id='$id'"; [/code] | |
Re: Why not use order by clause in your query itself ? [code=php] $query = "select * from table order by colname [asc | desc ]"; [/code] [asc | desc ] is optional. You can sort the records in ascending order or descending order on one or multiple columns. Or, you … | |
Re: Basically, you need another table (comments) with columns to store who wrote the comment, on whose profile was the comment written and the comment. (You also may need more columns like date). I hope every user has a unique userid. Store the userids ("from" and "to" ) and comment in … | |
Re: The above query doesn't work because, it will search for the record where shape is like "$searchshapeone" AND again, like, "$searchshapetwo". It will work only if there is a record in the database with shape like both $searchshapeone and $searchshapetwo. For example, If there is a record in the table … | |
Re: :) remove @ and check if it throws any error. You are supposed to delete the file with the extension ! ![]() | |
Re: As you have already said it yourself, you don't have to explicitly declare a variable as an array to use it like an array. You can simply use $var[] = "value"; This will treat $var as an array. But, its always a good practice to initialize a variable before using … | |
Re: You can do it in 2 ways. Configure a cron job to run everyday at a certain time and send out mails if there are any records for that particular date. The other way is to write a script and execute it manually everyday. | |
Re: This has been discussed so many times. Either use ajax or this way. In the first dropdown list, list all the states. Have an onchange event to submit the form for the 1st dropdown list. When a user selects an option from the 1st dropdown list, onchange event will be … | |
Re: I said it in the other thread, have an onchange event to submit the page when you select a value from the dropdown list. When the page is submitted, you can know which option was selected from the dropdown list. ($val = $_POST['dropdownlistname']; ) Then query the table with this … | |
Re: [QUOTE=jasimp;568624]This would make an interesting game. Counting our post count ;) 2602[/QUOTE] lol..That would be an infinite loop. Everytime we post our 'post count', it will be increased by 1 ! | |
Re: Yep ! <head> tag is the right place to put meta tags. I haven't come across caching problem, but maybe you can use this. [code=php] <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?> [/code] Source: [url]http://nl2.php.net/header[/url] Ex. 2 | |
Re: You can find anything on google ! Well, Just install eclipse and install this plugin.. [url]http://sourceforge.net/project/showfiles.php?group_id=57621[/url] | |
Re: Check if the number is greater than 0. If it is, then show it in green and negative in red. :-/ What is the problem ? | |
Re: [quote]list($ngclasses) = mysql_fetch_array($result);[/quote] is wrong. It will assign the 0th index of the array fetched by $result to a variable $ngclasses. If you want $ngclasses to be an array, don't use list. Well, here is more on list. [url]http://nl2.php.net/manual/en/function.list.php[/url] | |
Re: [code=php] <?php //page1.php session_start(); $_SESSION['number'] = 10; header("Location: page2.php"); ?> [/code] and [code=php] <?php //page2.php session_start(); echo"number= ".$_SESSION['number']; ?> [/code] [quote]If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it … | |
Re: [QUOTE=Abbigail;576339]so your the queen[/QUOTE] Yep! Daniweb kingdom is ruled by a queen ;) | |
Re: Writing data to a file is very simple. Open a file with different modes using fopen. Write contents to it using fwrite. Then close the file. [url]http://nl.php.net/manual/en/function.fopen.php[/url] . I dont understand what exactly you mean by enable the form to upload a file to my server. Isn't file uploading enabled … | |
Re: You can pass variables from 1 page to another through URL (ie., GET method), through forms (ie., POST method), by using Sessions or by using Cookies. [url=http://www.w3schools.com/PHP/php_get.asp] get method [/url] , [url=http://www.w3schools.com/PHP/php_post.asp] post method [/url] , [url=http://www.w3schools.com/PHP/php_sessions.asp] sessions [/url] and [url=http://www.w3schools.com/PHP/php_cookies.asp] cookies [/url] ! | |
Re: [quote]ust off the top of my head I'm assuming the addslashes function will take nasty characters like " and add a slash in front of them (which is used for cleaning a variable to be INPUT into the database?) and then stripslashes is to be used when they come back … | |
Re: [code=php] $query = "select * from table where AuthorFirstName like '%$searchstring%' or AuthorLastName like '%$searchstring%'"; [/code] This will look for $searchstring in both AuthorFirstName and AuthorLastName fields. :) I hope thats what you want ! | |
The End.