Search the Community
Showing results for tags 'field'.
-
Hi guys .. please help me .. I don't know how to do this and I tried but there were no satisfied results.. I want to retrieve a Title (ing_title) from a database called k_db2 , in a table called content_langs depending on its ID , which called ing_contID example: if ing_contID=1 , then show the ing_title with this id ing_contID the above code should be in a php file .. then I want to include this php file inside the header of my website.. by importing the ing_contID from the database and depending on it the title should be shown.. I really tried but I couldn't find any solution .. if you could help me in the first part of this problem I'll be glad ..
-
Hi I have a MySql database and wondered if there is a code to search a table field with a given string and display the number of unique occurrences. The table is asterisk_cdr and would like to know how many calls received daily on a perticular channel. Thanks shmideo
- 9 replies
-
- search code
- string
-
(and 1 more)
Tagged with:
-
Right now I am using a session to get search's input terms and place them into meta tags(title). It works; the only issue is that the search terms lag 1 page behind. For eg. If i search "flowers" on first try, it will show flowers in the metas(title). Next I input "treehouse" in search; instead of "treehouse" showing in the metas, it'll still show me the previous term "flowers". Now if I do a third search with a new term, it won't show the new term in metas, it'll show me the previous term "treehouse". Why is this happening? Am I doing something wrong? This is only an issue with meta tags. Search itself works fine. It shows results on a page as it's suppose to.
-
Hi all, I'm fairly new with PHP/HTML and I'm working on implementing a simple comment field for a website I'm designing. The issue I'm having is that the comment field seems to only display integers, and not strings. Other then not displaying words, I'm not getting any errors. The database seems to be working fine, however it's only saving Integers, and not Strings. I've checked the columns and the one which is holding the comments is using type "text", and the ID is "int". I don't believe the issue is with the table, but rather somewhere with the PHP. Here is the code below: <?php 02 mysql_connect("localhost","root","changeme"); 03 mysql_select_db("certestdb"); 04 $comment=$_POST['comment']; 05 $submit=$_POST['submit']; 06 07 08 $dbLink = mysql_connect("localhost", "root", "changeme"); 09 mysql_query("SET character_set_client=utf8", $dbLink); 10 mysql_query("SET character_set_connection=utf8", $dbLink); 11 12 13 14 if (!empty($_POST)) { 15 //$comment=$_POST['comment']; 16 //$submit=$_POST['submit']; 17 18 19 if($submit) { 20 if($comment) { 21 $insert=mysql_query("INSERT INTO comment (comment) VALUES ($comment) "); 22 } else { 23 echo "please fill out all fields"; 24 } 25 } 26 } 27 28 ?> 29 30 <html> 31 <head> 32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 33 <title>Comment box</title> 34 </head> 35 <div style="width:100px; height:100px; margin: 2 auto;"> 36 <body> 37 <center> 38 <form name="comment.php" method="post" action=""> 39 <table> 40 <tr><td colspan="2">Comments: </td></tr> 41 <tr><td colspan="5"><textarea name="comment" rows="5" cols="150"></textarea></td></tr> 42 <tr><td colspan="2"><input type="submit" name="submit" value="Comment"></td></tr> 43 </table> 44 </form> 45 46 <?php 47 $dbLink = mysql_connect("localhost", "root", "changeme"); 48 mysql_query("SET character_set_results=utf8", $dbLink); 49 50 51 52 $getquery=mysql_query("SELECT * FROM comment ORDER BY id DESC"); 53 while($rows=mysql_fetch_array($getquery)) { 54 $id=$rows['id']; 55 $comment=$rows['comment']; 56 echo $comment . '<br/>' . '<br/>' . '<hr size="1"/>'; 57 } 58 59 ?> 60 61 </body> 62 </html> If anyone might know what is causing this and could help, it would be much appreciated! Thanks!
-
I would appreciate some assistance. I am very green when it comes to programming so please excuse my lack of understanding / number of questions I have two sites for a client, both of which use a similar form structure, both of which are built in PHP. The form is a quotation request form with 3 pages on it, the last of which has an area for the customer to enter their contact details and also has a 'comments' section for them to submit specific comments regarding their enquiry. When a customer submits the quote, and email is sent to the company and it specifies the contact details, what the enquiry was in relation to, and the location. Here however is the issue. On one of the sites, anloffshorecontainers.com.au there is no issue. Comments submitted are transferred in the emai. The other site however, anlcontainers.com.au sends the details to the client capturing everything except whatever is included in the 'comments' box on the form. I compared the code between the two sites for this form, and as I said I am not a programmer, but found the only difference was that on the form that was working (on the attached coding titled 'OFFSHORE') there is the code: id="comment" inserted within the relevant section of code, however this is missing off the coding for the site that has the issue (called 'MAIN' on the attached). I thought perhaps this was the issue so added this id="comment" into the code on the php template in WordPress and it has made no difference. My questions: 1. How do I fix this so that the comments are sent in the email to the client for the site having issues? 2. For my own learning, what does id="comment" mean? I assumed this picked up text in the comments section and transferred with the email, however I may be completely off track. I have attached the relevant code pieces I refer to, along with the full code for the page on which we are having issues where this id="comments" is missing on line 223. Thanks Will Issues with Comments on form for sites.txt
-
hi i was just wondering how i would stop spaces at the start of a field ive looked all over and i cant find anything. what i need is to stop people from putting spaces at the beginning e.g. an error will occur if i type ' Dave'
-
Hi all, I've a problem with my PHP code. I've a page, where you can select multiple pages, which will be displayed at the related section on my site. So far, you can select the pages, and they will be injected into the database, and they will be displayed on the site. My only problem is: the pages won't be selected on the edit page. I've this piece of code, and I don't know what I'm doing wrong. <?php $id = $_POST["id"]; $sql=mysql_query("SELECT `title`,`url`,`volg`, `headerpicture`, `picture`, `product_id` FROM `pagina` WHERE `id`='".$id."' LIMIT 0,1"); $row=mysql_fetch_assoc($sql); echo '<select MULTIPLE name="related[]">'; if ($row['related'] != '') $related_array=explode(',',$row['related']); else $related_array=array(); $query="SELECT `id` FROM `producten`"; $sql=mysql_query($query) or die(mysql_error()); while($line=mysql_fetch_array($sql)) { $query1="SELECT `title` FROM `pagina` WHERE `product`=1 AND `product_id`='".$line['id']."'"; $sql1=mysql_query($query1); if(mysql_num_rows($sql1) >0) { $line1=mysql_fetch_array($sql1); $selected=' '; foreach($related_array as $related_line) { if ($related_line == $line['id']) $selected=' selected '; } echo '<option'.$selected.'value="'.$line['id'].'">'.$line1['title'].'</option>'; } } echo '</select>'; ?> What am I doing wrong? Is there a piece of code I need to script?