Step 1: Find the ratio directly from the y-coordinate differences, instead of solving for k using the section formula.
Since $P(x,7)$ divides the segment from $A(-5,4)$ to $B(7,9)$ internally, the ratio $AP:PB$ can be found straight from how far along the y-values $P$ sits, because y increases steadily and uniformly along the segment.
\[ AP : PB = (y_P - y_A) : (y_B - y_P) = (7-4) : (9-7) = 3 : 2 \]
Step 2: Apply this same ratio 3:2 to the x-coordinates, since the point divides the segment in one single fixed ratio for both coordinates.
\[ \frac{x - x_A}{x_B - x} = \frac{3}{2} \]
\[ \frac{x - (-5)}{7 - x} = \frac{3}{2} \]
Step 3: Cross multiply and solve this fresh equation for x.
\[ 2(x + 5) = 3(7 - x) \]
\[ 2x + 10 = 21 - 3x \]
Step 4: Collect the x terms on one side.
\[ 2x + 3x = 21 - 10 \]
\[ 5x = 11 \]
\[ x = \frac{11}{5} = 2.2 \]
Final Answer:
The ratio in which $P$ divides $AB$ is $3:2$, and the value of $x$ is $2.2$.
\[ \boxed{\text{Ratio } 3:2,\ x = 2.2} \]