37 Solved Topics

Remove Filter
Member Avatar for mpc123

Hi I have a varible that is set at as a different value for each page this is called $mode. Currently I have succesfully set up a drop down menu that can filter the table and refresh the results based on that filter chosen, yet I need to call this …

Member Avatar for mpc123
0
228
Member Avatar for mpc123

Hi I need to look in a field to find the text same as another field I have this at the moment but it does not work, hoep you can help update TAB1, TAB2 set `field3` =`field4` where FIND_IN_SET('`FIELD1`', '`FIELD2`') I feel FIND_IN_SET is not the right thing as the …

Member Avatar for mpc123
0
123
Member Avatar for mpc123

Hi I need to delete words before a set of words in a field. eg delete the words before the word price in that field. I already have a query to replace a certain word but cant see how adapt it to do what I require update TABLE set `field` …

Member Avatar for diafol
0
189
Member Avatar for mpc123

I have this to make a file ... but the file created is only ever .php, it is like it is not echoing the field name. $newfile ="" . str_replace(' ','-',trim($file['title'])) . ".php"; and the next one i tried to echo out in the page came out blank too? <?php …

Member Avatar for mpc123
0
190
Member Avatar for mpc123

Hi I need to update a colomn with the result of colomn 1 divided colomn2 I have tried update TABLE set colomn =SUM(colomn1 / colomn2) but get [Err] 1111 - Invalid use of group function IF anyone can help please

Member Avatar for mpc123
0
134
Member Avatar for mpc123

HI Hope somebody can help. My query updates a colomn in tab1 from a row in tab2 but only if a colomn in tab1 is equal to that of a row in tab2. tab 1 has 360000 rows tab 2 has 477 rows The update query runs for ages and …

Member Avatar for Ewald Horn
0
235
Member Avatar for mpc123

HI I have an else if statement that all the results are coming out as the first if even though in the info row they are different in the table, hope someone can help. // showbanners if($row['info'] ="Some Apples") { $showbanners = '<img src="1.png"><br><br><img src="2.png">'; } elseif($row['info'] ="Some Bananas") { …

Member Avatar for mpc123
0
142
Member Avatar for mpc123

Hi Im haveing a problem with ucwords and FINDINSET in a query I have tried all sortsof ways but just get errors I currently have and get FUNCTION ucwords does not exist. Can anybody help please $query = "SELECT * FROM TABLE1, TABLE2 WHERE FIND_IN_SET(ucwords(TABLE1.field), TABLE2.field)";

Member Avatar for mpc123
0
226
Member Avatar for mpc123

I have the following code but when $newstring echos out as '.-ucwords(strtolower(-['First.Name']))-.-'-'.-ucwords(strtolower(-['Last.Name']))-.-.php It should echo out the fields from the database noy just that code. If someone could help please $txtname = "'. ucwords(strtolower($row ['First.Name'])) . '-'. ucwords(strtolower($row ['Last.Name'])) . "; $newstring = str_replace(" ", "-", $txtname); while($row = mysql_fetch_array($result)) …

Member Avatar for mpc123
0
145
Member Avatar for mpc123

Hi I have an issue where by I have lots of products in a field which are comma delimited I want to replace those product words with a id number that I have in a different table. I currently use FIND INSET to replace a tab to the comma but …

Member Avatar for mpc123
0
216
Member Avatar for mpc123

HI Have a field in database which has multiple of the same number in, I have got a query of which works with the field with 1 in but then want it to then go to ++ so if I limit 9 results they will show with this query for …

Member Avatar for pritaeas
0
144
Member Avatar for mpc123

Hi im trying to random showing items from data base and when echoed the same ones appear? If anyone could help that would be great. This is the query SELECT * FROM TABLE1, TABLE2 WHERE FIND_IN_SET(TABLE2.FIELD1, TABLE1.FIELD1) and `FIELDNAME` >= RAND() LIMIT 10

Member Avatar for pritaeas
0
147
Member Avatar for mpc123

So I have this query but the error is wrong syntax around '%'$txt2',%' - what would I have to change this too please... thanks What I am looking for in the field is anything that has txt2, with things after it or just txt2 on its own without anything after …

Member Avatar for mpc123
0
128
Member Avatar for mpc123

Hi im using FIND iN SET in a query like below, but i get an error stating that im using wrong syntax and also Warning: mysql_fetch_array() expects parameter 1 to be resource $result = mysql_query("SELECT * FROM table FIND_IN_SET($txt2, field)") or trigger_error(mysql_error().$sql); Hope someone can help with this, thanks

Member Avatar for mpc123
0
106
Member Avatar for mpc123

Hi I have this working for the query to output the result but the if zero results echo is not working, and I cnat see why, if anyone can help please, there is no error that comes up and to test there is nothing in the database table, it works …

Member Avatar for mpc123
0
122
Member Avatar for mpc123

Hi I am trying get a query to join 2 tables and a result on the information in both. At the moment I have the following $query = "SELECT * FROM TABLE1, TABLE2 Where 'TABLE2.field1' LIKE '%TABLE1.field2%'"; The problem is TABLE2 has a field with names in but TABLE1.field2 has …

Member Avatar for mpc123
0
155
Member Avatar for mpc123

Hi I am trying to get to download images into a file from database field urls onto my server as there is lots of them. I think im on the right track. I currently have an error Parse error: syntax error, unexpected T_STRING in getimages.php on line 11 Hope someone …

Member Avatar for mpc123
0
144
Member Avatar for mpc123

Hi Im trying to get mysql_query result with foreach set up and i am just planning what i am going to do but I am stuck with adding foreach into my code so far. Basically F field has several different options which are duplicated lots of times, so i need …

Member Avatar for mpc123
0
264
Member Avatar for mpc123

HI , I basically have made something that I require work in html but now trying to convert to get the results from data base but get this error and cant work out how to change it, if someone could help unexpected T_STRING, expecting ',' or ';' on line 69 …

Member Avatar for mpc123
0
153
Member Avatar for mpc123

Hi Hope someone can help with this. I have javascript set up how i want it in a normal html page but now need to ensure i can call a result using php with it. My code throws out an error The code states Parse error: syntax error, unexpected T_STRING, …

Member Avatar for mpc123
0
156
Member Avatar for mpc123

HI I seem to have a problem with a drop down menu, the code seems to work fine and the values are showing in source code but do not show on the page???? Another issue is I dont know how to move forward after this to make a combo drop …

Member Avatar for AleMonteiro
0
192
Member Avatar for mpc123

Hi I have an issue whereby I need to replace characters in a field and also narrow the amount of characters down, but sturggling with putting them both together I have 2 seperate lines of code to do them both seperately that work, but struggling to get them together btw …

Member Avatar for mpc123
0
196
Member Avatar for mpc123

Hi I have variables set in the head of the page as they are used for other parts of the page. I have a problem where by I am trying to get the variable to echo out in the result. I have tried several ways but either ther eis an …

Member Avatar for AndreRet
0
115
Member Avatar for mpc123

Hi I have been struggling with this for a while and cant find the answer, the code below shows my else if statement everything goes fine until using the else if statement and ' . $img . ' ends up being blank. It should be if field 4 is 0.00 …

Member Avatar for mpc123
0
111
Member Avatar for mpc123

Hi I am trying to join tables and fields and one of the tables had fields like field.field . So when I try to do a join it does not know the table field name as you end up with something like Table1.field.Name How do I get round this please …

Member Avatar for mpc123
0
116
Member Avatar for mpc123

Hi I have to echo out some fields but "field 1" "field 2" "field 3" has a numeric value. I need to divide field 1 by field 2 and then take that result off of field 3 and echo that result. The code is part of a table this is …

Member Avatar for mpc123
0
176
Member Avatar for mpc123

Hi I am creating some files of which are taken from database fields, the problem is the field in the database has &pound; in which is great as it is needed when in the browser page. The problem I have is when making the file is that it creates the …

Member Avatar for mpc123
0
88
Member Avatar for mpc123

Hi Im having a go at this, but not good on the php thing, thats why im hoping you can help. I am trying to set up a jump script from one I have used for 1 or 2 urls, now I have a database of around 500000 lines, each …

Member Avatar for mpc123
0
131
Member Avatar for mpc123

I have a very large table and would need to split into lots of tables. The large table has lots of fields of which `Model.ID` gives a number of the product and this is repeated lots of times with other fields used in the row. I need to create lots …

Member Avatar for mpc123
0
94
Member Avatar for mpc123

I have this very easy form to store info in a database table but i would like to be emailed once somebody has entered the details, how would i do this please? Form [code=php]<form action="insert.php" method="post"> <div align="center">Firstname: <input type="text" name="firstname" /> Lastname: <input type="text" name="lastname" /> Email: <input type="text" …

Member Avatar for mpc123
0
92
Member Avatar for mpc123

Hi im looking to echo a result of a query code i have at the moment is connections + [code=php] <?php $result = mysql_query("SELECT SUM(tablefield) FROM table") or die(mysql_error()); [/code] got no idea if this is right, i seem to have got really mixed up with this. Can anybody help …

Member Avatar for d5e5
0
113
Member Avatar for mpc123

Hi , hope you can help i have this code [code=php] <?php mysql_connect("localhost","x","x"); mysql_select_db("x"); $result = mysql_query("SELECT * FROM x") or die(mysql_error()); echo "<table class = feature >"; echo "<tr> <th></th> <th></th> <th></th> </tr>"; while($row = mysql_fetch_array( $result )) { echo "<tr><td>"; echo $row['Date']; echo "</td><td>"; echo $row['Title']; echo "</td><td>"; …

Member Avatar for mpc123
0
84
Member Avatar for mpc123

I have this code part of a bigger table with different field names being echoed. [code=php] echo "<tr><td>"; echo $row['car']; echo "</td><td>"; echo $row['caravan']; echo "</td><td>"; [/code] I need 2 pieces of help please. I want to add an image of that car, the image is in a folder on …

Member Avatar for MooGeek
0
124
Member Avatar for mpc123

I have this code presently for null to say free but i need also if the info in the ProductPrice field is 0 [code=php] echo is_null($row['ProductPrice']) ? "FREE" : $row['ProductPrice']; echo "</td><td>";[/code] Please help

Member Avatar for mpc123
0
112
Member Avatar for mpc123

Sorry very very new to php , at the end of my table is the following [code=php]echo $row['ProductUrl']; echo "</td></tr>"; } [/code] i want to have an image show on the page and on click of that image it then go to the product url. The [ProductUrl] from data base …

Member Avatar for metalix
0
103
Member Avatar for mpc123

Please help with this if you can My example code below is part of a table that echos several fields, for this field I need to echo the text of the field which the below example code now does, but i need to make it state N/A if the field …

Member Avatar for Usernamex235
0
1K
Member Avatar for mpc123

Please can somebody help with this. I want a Buy Now image to go to the producturl in the database, at the moment I am just echoing , so it only shows the text of the url in the cell. my code currently is [code=php]echo $row['ProductUrl']; echo "</td></tr>"; [/code] Hope …

Member Avatar for hielo
0
135

The End.