Search found 10 matches
- Sun May 17, 2009 11:24 am
- Forum: Javascript
- Topic: Does not get items from select box to the database
- Replies: 2
- Views: 474
Re: Does not get items from select box to the database
Mistakes in your code code you didn't specify name attribute for select box. Also default method for form is GET which needs to POST to get POST variable.*/ If you want to recieve multiple values from select box then you should use name of field like name='yyy[]'. If you will use name='yyy' it will ...
- Tue Feb 03, 2009 10:25 am
- Forum: PHP - Code
- Topic: How to redirect to link with <select option in php?
- Replies: 1
- Views: 249
Re: How to redirect to link with <select option in php?
<script type='text/javascript'> function openurl() { site = document.myform.url[document.myform.url.selectedIndex].value; if(site!="") { location.href = site; } } </script> <form name='myform'> <select name="url" onchan...
- Fri Jan 30, 2009 6:31 am
- Forum: PHP - Code
- Topic: Here's a tough one for ya! Try to follow along:
- Replies: 3
- Views: 180
Re: Here's a tough one for ya! Try to follow along:
There is no variable name declared with $leadID inside your function. If you want to use value of $leadID declared outside the function then you should declare it as global inside your function before using it and you can also print the value of $q to check if you are executing correct query or not....
- Fri Jan 30, 2009 6:18 am
- Forum: PHP - Code
- Topic: Partial Record Display
- Replies: 2
- Views: 206
Re: Partial Record Display
SELECT LEFT(JobDescription, 100) FROM TABLENAME
// IT WILL PICK FIRST 100 CHARACTERS OF JOB DESCRIPTION FIELD
OR
SELECT LEFT(JobDescription, LENGTH(JobDescription)/2) FROM TABLENAME
// IT WILL PICK FIRST HALF CHARACTERS OF JOB DESCRIPTION FIELD
// IT WILL PICK FIRST 100 CHARACTERS OF JOB DESCRIPTION FIELD
OR
SELECT LEFT(JobDescription, LENGTH(JobDescription)/2) FROM TABLENAME
// IT WILL PICK FIRST HALF CHARACTERS OF JOB DESCRIPTION FIELD
- Fri Jan 30, 2009 5:59 am
- Forum: PHP - Code
- Topic: Cannot get sessions working for login
- Replies: 5
- Views: 248
Re: Cannot get sessions working for login
session_start() should be very first line of php file. There should not be even one blank space before <?php tag.
- Fri Jan 30, 2009 5:53 am
- Forum: PHP - Code
- Topic: How to import the txt file to database table
- Replies: 3
- Views: 247
Re: How to import the txt file to database table
Use the following MySQL Query <?php mysql_query("LOAD DATA INFILE 'filename.txt' INTO TABLE 'tablename' FIELDS TERMINATED BY ','"); ?> Note: 1.Your table should have same number of fields as in your text file for proper import. 2.You have to store your text file in mysql/data d...
- Fri Jan 30, 2009 5:15 am
- Forum: PHP - Code
- Topic: Need help on how to hyperlink query results in a table!
- Replies: 3
- Views: 123
Re: Need help on how to hyperlink query results in a table!
Sorry there was a problem with quotes. It working now while($row = mysql_fetch_array($result)) { $leadID = $row['LeadID']; echo "<tr>"; echo "<td><a href=\"details.php?leadID=$leadID\">$leadID</a></td>"; echo "<td>" . $row['CID'] . "</td>"; echo &quo...
- Thu Jan 29, 2009 2:06 pm
- Forum: PHP - Code
- Topic: Need help on how to hyperlink query results in a table!
- Replies: 3
- Views: 123
Re: Need help on how to hyperlink query results in a table!
while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td><a href=\"details.php?leadID=$row['LeadID']\"" . $row['LeadID'] . "</a></td>"; echo "<td>" . $row['CID'] . "</td>"; echo "<td>" . $row['Category'] . "</td>&quo...
- Thu Jan 29, 2009 1:52 pm
- Forum: PHP - Code
- Topic: Min Hrs Days Months Script
- Replies: 4
- Views: 257
Re: Min Hrs Days Months Script
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too. <?php $date1 = strtotime(date('d-M-Y h:i:s')); // current dat...
- Thu Jan 29, 2009 12:58 pm
- Forum: PHP - Code
- Topic: Getting Next Valid Row and Previous if exists
- Replies: 3
- Views: 1268
Re: Getting Next Valid Row and Previous if exists
You can try the following code to get next and previous record from database. Suppose your records are stored in following order in database: ID Title 1 Title 1 3 Title 3 5 Title 5 6 Title 6 7 Title 7 Let say current record ID is : 5 $currentId = 5 Query to get previous id : "SELECT id FROM TAB...