- Upvotes Received
- 10
- Posts with Upvotes
- 9
- Upvoting Members
- 8
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- Marine fish breeding
40 Posted Topics
Re: You just have to give them different names like: subcategory.php?category=Drivers&page=1 You are limited though on the length of your querystring. | |
Re: If you don't know the configuration, put up a simple page that will display the information for you <?php phpinfo(); ?> That's all you need. | |
Re: You want to use `urlencode($row->dealer)` see http://ca3.php.net/manual/en/function.urlencode.php | |
Re: I just created a couple little test pages and the $_SESSION passed fine. session.php <?php session_start(); $_SESSION['test']=TRUE; var_dump($_SESSION); ?> <br /> <a href="sessiontop.php" target="_TOP">sessiontop</a> sessiontop.php <?php session_start(); var_dump($_SESSION); | |
Re: Everything will remain in $_REQUEST unless you specifically modify or remove it, allowing you to get the same information repeatedly from it. | |
Re: From this section change lines 8, 11, 25, 28 [CODE] <tr> <td>Job type:</td> <td> <select name="typeid"> <?php $query = "SELECT * FROM jobtype"; $resultset = $db->query($query); while ($jrow = mysql_fetch_array($resultset)) { ?> <option value="<?php echo $jrow["typeid"]; ?>" <?php if($jrow['typeid']==$row['jobtypeid']){ echo 'selected="selected"';} ?>><?php echo $jrow["type"] ?></option> <?php } ?> </select> <br … | |
Re: For a solution that may work for you, see [url]http://andrewcurioso.com/2010/06/detecting-file-size-overflow-in-php/[/url] | |
Re: Your login seems to be OK, it's just the sql you're building that seems off. I'm actually surprised you get a result and not a DB error. Your first code snippet shows that your column names are location and job but in your second snippet you have your column names … | |
Re: Here is a version using javascript to deal with the subcategory selection. I wouldn't use this if the list were large but works ok for smaller ones. I threw an output at the end to output posted values of selections for demonstration. If your form action was to another page … | |
Re: 1st - you want to use \n\r not /n/r 2nd - take a look at this thread as I think it's the same/similar as what you are doing [URL="http://www.daniweb.com/forums/thread280838.html"]http://www.daniweb.com/forums/thread280838.html[/URL] | |
Re: [QUOTE=f.damati;1223952]I am developing a web page which retrieve data from a seperate mysql server on the same network musql_connect('192.16.1.2:3306', 'root', '123'); but ana error shows Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '192.16.1.2' (13) in /var/www/html/index.php on line 3 [COLOR="Red"]the 2 servers are on 2 different virtual network … | |
Re: Seems to be in an appropriate order now. How did you want them sorted if not by the order the days come in? ![]() | |
Re: dbHome.php ========== line 15 - you have a typo (valie instead of value) lines 26-49 are why you get a blank row added. This is inserting a row by simply loading the page, and since you didn't post anything, it's blank. Delete this section. dbInsert.php ============ $_POST['Console'] is an array … | |
Re: Not knowing exactly what you want to do with the selected list of files, I made some changes based on ideas I had of what you might be doing with the list. Hopefully it points you in the right direction. [CODE] $localdir = 'C:/somedir'; $dh = opendir($localdir); // -------------------------------------------------------------------------- // … | |
Re: Your problem is with [icode]$calculate = oci_fetch($total);[/icode] $calculate is catching a BOOL value of whether the fetch was successful or not. What you want to be doing instead is oci_fetch_array and then obtain the value out of the first column. [code=php] $res = oci_fetch_array($total, OCI_NUM); $calculate = $res[0]; [/code] | |
Re: [CODE=php] $selecteddate = $_POST['Releasedate']; $selectedplatform =$_POST['Platform']; $selectedstyle = $_POST['style']; $whereclause = ""; if ($selecteddate!="*") $whereclause.= " AND date='$selecteddate' "; if ($selectedplatform!="*") $whereclause.= " AND Platform='$selectedplatform' "; if ($selectedstyle!="*") $whereclause.= " AND Style='$selectedstyle' "; if (strlen($whereclause) > 0) $whereclause = " WHERE ".substr($whereclause,4); $query="SELECT * FROM $table $whereclause"; [/CODE] If you … | |
Re: Your variables [icode]$name $lastname $email[/icode] that you are using in [CODE] $sql="UPDATE $tbl_name set name='$name', lastname='$lastname', email='$email' where id='$id'"; [/CODE] have not been set anywhere so you'll be updating your DB with NULLs. Other than that, this ran for me the first time. | |
Re: In main.php change this [iCODE]echo "<IMG SRC=\"resize_image.php?pictures/1.jpg\">"; [/iCODE] to [iCODE]echo "<IMG SRC=\"resize_image.php?image='pictures/1.jpg'\">"; [/iCODE] and add something to resize_image.php at the top like [iCODE]$image=$_GET['image'];[/iCODE] Now I'm assuming that Club_Badge.jpg and 1.jpg are not in the same folder. That Club_Badge.jpg is in the same folder as your php scripts and 1.jpg is … | |
Re: In line 11, you are assigning your calculation to $row['price1'] and never using it anywhere. Your calculations do have to be done for each product record if you want them adjusted. There should be some price showing for all your records providing there is a price in the DB. But … | |
Re: I don't see anything specifically wrong with your php. But I did change short open tags and put a space before "or die". The one thing you do want to change though is the placement of your [icode]<table></table>[/icode] tags. They should be outside your while loop as you don't want … ![]() | |
Re: try getting rid of the @ and ' around primary number. Numbers shouldn't be quoted in SQL [CODE] mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query("SELECT * FROM basicinfo WHERE primary=$local_item"); [/CODE] | |
Re: You seem to be using [icode]$_FILES[[COLOR="Red"]'uploaded'[/COLOR]]['tmp_name'][/icode] and then you use [icode]$_FILES[[COLOR="Red"]'uploadedfile'[/COLOR]]['tmp_name'][/icode] near the end of this code piece. Maybe you intended to use [COLOR="Red"]'uploaded'[/COLOR]. | |
Re: Added comments to the end of each line. [QUOTE=azegurb;1210628]here i dont understand what does this function do. any can explain it to me thanks beforehands [CODE]function query($qry) // Pass in a query. { if(!isset($this->database_link)) $this->connect(); // Check if DB connection exists and if not, creates one. $result = mysql_query($qry, $this->database_link) … | |
Re: [CODE] $output = ""; $array = explode("\r\n\r\n", $_POST['freetext']); foreach($array as $paragraph) $output .= "<p>$paragraph</p>\n"; echo $output; [/CODE] | |
Re: Change your quotes from ' to " surrounding your query; [CODE]$query = "INSERT INTO `user` (`id`, `name`, `password`, `char_name`) VALUES (NULL, '$name', '$pass', 'test')";[/CODE] | |
Re: [QUOTE=whitestream6;1207691]I am currently only extracting from the [b]epdata[/b] table but want to extract from multiple tables; just not sure how to get this code to work properly.[/QUOTE] Multiple tables? or Multiple databases? You said tables here but databases in your first post. If it's just multiple tables, the correct SELECT … | |
Re: [QUOTE=dmkc;1209321]Hi everyone, Ok, what I want to do is display a url that's stored in my database within an iframe when the specific record is selected. The code I had to display the record correctly is: [code] <?php $conn = mysql_connect(HOST,USER,PASS); $db = mysql_select_db("***") or die( "Unable to select database"); … | |
Re: For deletion (either full delete or changing position to -1), execute an update to change all positions greater than that by -1. [icode]UPDATE table1 set POSITION = POSITION -1 where POSITION is > $deletedpositon[/icode] Do this for each position removed, one at a time. If you allow multiples to be … | |
Re: Maybe this will work for your situation and point you in the right direction. [CODE=PHP] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=encoding"> <title>Print Selected Rows</title> </head> <body> <?php if(!isset($_POST["submit"])) { ?> <form action="" method="post"> <table><thead> <tr> <th>select</th> <th>Name</th> <th>Phone</th> </tr> </thead> <tbody> <tr> <td><input … ![]() | |
Re: Seems fine except for the query you are building for your INSERT. Maybe this will offer some assistance. [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=encoding"> <title>Insert title here</title> </head> <body> <?php $dbc = mysqli_connect('localhost', 'root', '', 'test') or die('Error connecting to MySQL server.'); … | |
Re: Insert Product and then retrieve the id by [icode]$productid = mysql_insert_id();[/icode] Insert Origin and then retrieve the id by [icode]$originid = mysql_insert_id();[/icode] Insert Image using above [icode]$productid[/icode] Insert Product_Origin using above [icode]$productid[/icode] and [icode]$originid[/icode] See PHP Manual for more information on [icode]mysql_insert_id()[/icode] [URL="http://php.net/manual/en/function.mysql-insert-id.php"]http://php.net/manual/en/function.mysql-insert-id.php[/URL] [CODE] $query = "INSERT INTO products (product_name, … | |
Re: A value of [icode]1[/icode] when printing [icode]$result[/icode] seems to me that the [icode]mysql_query[/icode] call was successful and returned a [icode]TRUE[/icode]. You can try using a [icode]mysql_affected_rows()[/icode] after the [icode]mysql_query[/icode] to see how many rows were updated. Also output your UPDATE statement so you can verify it's what you expect and … | |
Re: Give this a try. There are plenty of output statements to see what's going on. Please excuse the jumping between HTML, print_r and echo :D [CODE] <?php /* table 1 ....1...2 (ignore the periods, just used to line the column names up) a 93 87 b 73 27 table 2 … | |
Re: Save your class in a file and include it into another page the same as you would any php content. Example: you have a class Car saved in a file called car.php [CODE]require_once 'car.php';[/CODE] | |
Re: [QUOTE=Helleshtern;1200399]Hello! I have a script to update multiple rows in database but it update [B]all[/B] and I need to [B]only values in checked rows[/B] be updated. What should I change to update only checked rows? [CODE] <?php include 'connect_db.php'; $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); // Count table rows $count=mysql_num_rows($result); if($_POST['Submit']) … | |
Re: Try this. [CODE] $id = NULL; $team = $_POST['team']; $round = $_POST['rounds']; // THIS IS THE value of the drop down, could be 5 could be 40. $time = '0'; $result = 'Undecided'; /*** connect to db ***/ $conn = dbConnect('admin'); /*** set the error mode ***/ $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql … | |
Re: [QUOTE=Encrypted;1200139]Hello, I'm trying to pull data from multiple tables in a single mysql_query and I'm having trouble displaying the data that's pulled. Here's what I've got so far.. the highlighted code is the part that doesn't work. (sorry in advanced for the sloppy code.. i've been copying/pasting stuff all over … | |
Re: It seems that your problem is that you are only checking the last record that is returned from the DB. You need to place your intersect testing inside the while() loop, dropping out on a failure. | |
Re: With the portion of code you provided, it looks to me that your problem is $_POST['opid'] When you first load your form, 'opid' doesn't exist in the _POST as you haven't posted it yet. The next error is then the result of an empty $opids making your SQL ... IN … |
The End.