370 Posted Topics

Member Avatar for earlxph8

The id in your table needs to be set to Auto Increment and that will then mean every time you add a new record that database will assign the next appropriate id for you to that record. With regard to selecting one record only <?php $id = // Assign the …

Member Avatar for simplypixie
0
22K
Member Avatar for simplypixie

I thought I had this sorted on another website but just can't resolve the problem now. I have a link that when clicked shows a form. The form is submitted through jquery ajax, runs the PHP and updates the html in a div on success. All fine. However, after the …

Member Avatar for simplypixie
0
980
Member Avatar for hwoarang69
Member Avatar for diafol
0
181
Member Avatar for jairuz.com.ph

What about trying your query like this (I have removed the NULL values as they are not required for your id column) if($_POST["Submit"]=="Submit"){ mysql_query("INSERT INTO tblUser VALUES ('$fname', '$lname')"); $new_id = mysql_insert_id(); for ($i=0; $i<sizeof($checkbox);$i++){ $sql2=mysql_query("INSERT INTO tblItems VALUES ('".$checkbox[$i]."', '$new_id')"); } }

Member Avatar for simplypixie
1
200
Member Avatar for TonyG_cyprus

Works fine for me - are you sure you just have the navigation in your external file, like this? <div class='navi'> <ul class='item'> <li><a href=''>Birthday</a></li> <li><a href=''>New Baby</a></li> <li><a href=''>Anniversary</a></li> <li><a href=''>Wedding</a></li> <li><a href=''>Driving Test</a></li> <li><a href=''>Moving</a></li> <li><a href=''>New Job</a></li> <li><a href=''>Retirement</a></li> <li><a href=''>Good Luck</a></li> <li><a href=''>Engagement</a></li> </ul> </div>

Member Avatar for TonyG_cyprus
0
142
Member Avatar for simplypixie

This is driving me mad. I am using jquery and ajax to run the php to update my database and that all works fine, but after the update (specifically adding records) I want to re-run the query to get all records so that the new one is displayed but nothing …

Member Avatar for diafol
0
1K
Member Avatar for garyjohnson

If I understand correctly what you are trying to do, why on earth do you have 2 separate databases for your albums and images rather than 2 tables in one database?? There are other errors in your code, firstly `$images[$i] = $row[0];` which will just keep populating your images array …

Member Avatar for diafol
0
241
Member Avatar for rfrapp

Looks fine to me (Chrome on Mac). Have you thought it may just be the scrollbar making it appear this way?

Member Avatar for EvolutionFallen
0
113
Member Avatar for jacob.tonna.58

Your query is formatted incorrectly, it should be $sql="UPDATE `$tbl_name` SET `works` = `works` + 1 WHERE `id` = '".$id."'" or die(mysql_error());

Member Avatar for simplypixie
0
393
Member Avatar for RaeesIqbal

Further to all the other error corections you have received above, to check one variable equals another you need to use == not just = so change: if ($newpassword == $confirmnewpassword)

Member Avatar for simplypixie
0
254
Member Avatar for Pitso.Dea

What exactly is the problem you are having (what errors etc) as WP comes with built in fuctions for adding images to posts or as featured images?

Member Avatar for techbrain
0
280
Member Avatar for showman13

I am very confused by your post and am thinking that what I am about to reply is incorrect as seems too simple, but here we go anyway just in case: SELECT * FROM table_name WHERE pos_id NOT IN (SELECT pos_id FROM position_table)

Member Avatar for showman13
0
194
Member Avatar for shilu2
Member Avatar for daniel.conlinjr.1

When inserting records you don't need a value for the id so your query should just be $sql = "INSERT INTO content VALUES('$title', '$body')";

Member Avatar for simplypixie
0
198
Member Avatar for PriteshP23

It is due to the fact that padding, borders and margins all add to the overall width of the div they are applied to (if you remove all these elements from your content div you will see what I mean). One solution is to add this to the top of …

Member Avatar for PriteshP23
0
251
Member Avatar for dstoltz

I really fee lfor you - sounds like a nightmare client. Is the site (or these pages) database driven or static html?

Member Avatar for dstoltz
0
170
Member Avatar for cheelo007

As GliderPilot says - however, just to clarify as well, the error you are getting is telling you that $subcategory (in your query) is either empty or in an incorrect format. Where is the value assigend to $subcategory coming from (I don't see anything in your code where a value …

Member Avatar for cheelo007
0
130
Member Avatar for jasleen_kaur

Your code for the add to cart would help, but in general (this is an example) if your button has name="add_to_cart", you just need to check it that data is posted: if (isset($_POST['add_to_cart']) { // Do what you need to do here }

Member Avatar for simplypixie
0
76
Member Avatar for showman13

To keep it really simple (unless I am missing something), you could just use SELECT * FROM trans_table WHERE from_id NOT IN (SELECT mem_id FROM position_table)

Member Avatar for showman13
0
198
Member Avatar for simplypixie

My brain is not functioning! I am trying to select a number of random images (lets say 3) from a selection of folders within one other folder and I am either over complicating the code or am missing something as I can't quite get it to work. What I have …

Member Avatar for simplypixie
0
709
Member Avatar for cdays

Turn on error reporting as if you are getting a completely blank page then something is going wrong in either the code at the top of the page, or one of your include files. <?php session_start(); ini_set('display_errors',1); error_reporting(E_ALL); // rest of code here ?>

Member Avatar for simplypixie
0
173
Member Avatar for suavedesign

I am not sure why you have so many stylesheets and inline style as well, but I think I have found your class for the widgets which has a right margin of 500px so it will always be pushed 500px from the right of the containing box as the page …

Member Avatar for suavedesign
0
136
Member Avatar for Dani

I might be totally worng, but would you not need to check for both a and b separately SELECT * FROM t1 WHERE a NOT IN ( SELECT a FROM t1 WHERE c = 5 AND d = 6 ) AND b NOT IN ( SELECT b FROM t1 WHERE …

Member Avatar for BitBlt
0
293
Member Avatar for aldred

Have you tried this to ensure you are getting the data passed through? print "<pre>"; print_r($_FILES); print "</pre>";

Member Avatar for LastMitch
0
612
Member Avatar for christian.i.wibowo

Try it like this $insert_sql = "INSERT INTO detail_paket (id_paket, menu_paket) select paket.id, %s from paket where paket.nama_paket='$nama_paket'"; $format_sql = sprintf($insert_sql, $data1[$i]); mysql_query($format_sql);

Member Avatar for simplypixie
0
396
Member Avatar for hwoarang69
Member Avatar for hwoarang69

Unless you are assigning the $_POST['main_category'] to a variable called $main_category_p somewhere that we can't see, then you won't get anything echo'd out. You either need to assign the posted value to your new variable `$main_category_p = $_POST['main_category'];`or you should be using if($_POST['main_category'] == "Choose..."){ $_POST['main_category'] = ""; } echo …

Member Avatar for Bob Hensley
0
193
Member Avatar for OsaMasw

If you really want to use sub-queries, and presuming you want to show all posts by each user, then this is the sort of thing you will need (I don't know how you want to layout on the page or what your columns are named in your table so have …

Member Avatar for simplypixie
0
945
Member Avatar for GlenRogers
Member Avatar for HunainHafeez

Change your Applications LI to this (and add a class to your parent ul): <ul class="vertical-menu"> . . <li><a href="#">Applicants</a> <ul class="submenu"> <li><a href="active-applicants.aspx">Active Applicants</a></li> <li><a href="inactive-applicants.aspx">Inactive Applicants</a></li> </ul> </li> . . </ul> And in your CSS (please change or add any additional required styling, this is the bare bones …

Member Avatar for simplypixie
0
97
Member Avatar for hwoarang69

Why on earth do you want to store someone's password in a session - no need and very insecure??? Regardless of this, your login is obviously working as you get redirected as per your code, but the username stored in the session is incorrect, nowhere in your script have you …

Member Avatar for diafol
0
343
Member Avatar for hwoarang69

Looking at what you have in the other preg_replace functions, shouldn't `#[^0-9#]i` actually be `#[^0-9]#i` With regard to your include files, that is down to you to check the paths to the files are correct I am afraid. As for the mysql_num_rows issue, your query will presumably not work until …

Member Avatar for hwoarang69
0
269
Member Avatar for GilbertB

You need to learn responsive design / development if you want your site to work on mobile.

Member Avatar for code739
0
85
Member Avatar for designershiv
Member Avatar for giturman810

Further to diafol's advice, in your current code, you have a lot wrong. This is what is should be (based on what you have already) - please compare this code to what you have to see your mistakes: <!-- <form action="ContactUs.php" method="POST"> this shouldn't be here --> <?php if (isset($_POST)) …

Member Avatar for simplypixie
0
305
Member Avatar for PowerCheez

It won't do anything as you have assigned the query to a variable that you are doing anything with so vchange it to if(isset($_POST['submit'])){ mysql_query("INSERT INTO arkentider (typ) VALUES('$_POST[typ]')") or die("Kunde inte lägga till ny räkning:<br />".mysql_error()); } // OR if(isset($_POST['submit'])){ $nypost = "INSERT INTO arkentider (typ) VALUES('$_POST[typ]')" or die("Kunde …

Member Avatar for PowerCheez
0
244
Member Avatar for simplypixie

I am baffled, I have the following query which should return 4 records but for some reason it is counting 8 records and returning each row twice. I know I could use distinct, but as I also know that there are no duplicate records in this table I don't want …

Member Avatar for simplypixie
0
135
Member Avatar for collinskawere

Please post the relevant sections of your stylesheet and html so we can help.

Member Avatar for Sahil89
0
176
Member Avatar for kumar.papneja

If you `print_r($_POST);` you should see what is being passed to the next page and it will hopefully help you understand why your quesry isn't working (because you are assigning the whole of these arrays to your new array when you need to run them through a foreach): $whereClauses = …

Member Avatar for simplypixie
0
5K
Member Avatar for ashking

Please post what you have, not the tutorial, so we can see exactly what you are doing.

Member Avatar for ashking
0
71
Member Avatar for Mikesmusings

Is your PHP really at the bottom of the page? If so, move it to the top before any html etc and add in an if statement to check if the form has been posted (i.e. `if (isset($_POST)) { ...... Do your DB stuff here ..... }` Does your table …

Member Avatar for Mikesmusings
0
382
Member Avatar for Clanstrom

If you really want to get the whole string after the ? you can use something like: $id = strstr($_SERVER['PATH_INFO'], '?'); $id = str_replace('?','',$id);

Member Avatar for simplypixie
0
245
Member Avatar for dhadha

You need to run your fetch_array through another while loop: while ($getthis = mysql_fetch_array($getsubject)) { echo "<option value=".$getthis['subjectID'].">".$test['subjectCode']."</option>"; }

Member Avatar for simplypixie
0
155
Member Avatar for guig
Member Avatar for simplypixie
0
262
Member Avatar for andyy121
Re: why

This doesn't do anything: <form action ="password generator" method="post"> It needs to be a proper file path, like: <form action ="password-generator.php" method="post">

Member Avatar for yoyo12345
-1
166
Member Avatar for ismael ahm@d

This is wrong: <option value= '1' <?php echo $cat_row->country_id; ?> > It should be: <option value= "<?php echo $cat_row->country_id; ?>" >

Member Avatar for ismael ahm@d
0
9K
Member Avatar for pilipino93

You have #Main in your CSS but `<div id="Mainpos">` in your HTML, your class and id names need to match what you have in your styelsheet, therefore it should be `<div id="Main">`

Member Avatar for pilipino93
0
95
Member Avatar for austenr

It is just a warning that at the time your variables have no values. Try moving this $wages=$_POST['wages']; $hours=$_POST['hours']; Into your if statement if (isset($_POST['submit'])) { $wages=$_POST['wages']; $hours=$_POST['hours']; Also `print_r($_POST)` to check that you are receiving values through your form post.

Member Avatar for simplypixie
0
131
Member Avatar for priya667
Member Avatar for diafol
0
2K
Member Avatar for websols180

if (isset($_GET['start'])) { $start=$_GET['start']; } Read [this article](http://www.simplyciousweb.com/web-development-tutorials/how-to-solve-php-notice-undefined-index/) to help further.

Member Avatar for websols180
0
302

The End.